Skip to content

Support push/pop window title sequence (CSI 22/23) #2668

@mitchellh

Description

@mitchellh

From #2667

Source: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

This is a fairly well defined sequence that is supported -- at least in its most basic push/pop form -- by many terminals (Kitty, iTerm, xterm). It can be combined with the smcup and rmcup terminfo entries to push pop by default (xterm does this) on alt screen.

The primary sequences we should support:

         Ps = 2 2 ; 0  ⇒  Save xterm icon and window title on stack.
         Ps = 2 2 ; 2  ⇒  Save xterm window title on stack.
         Ps = 2 3 ; 0  ⇒  Restore xterm icon and window title from
       stack.
         Ps = 2 3 ; 2  ⇒  Restore xterm window title from stack.

We can ignore the "icon title" variants as they aren't used by any modern window managers that I know of. We can implement those later as needed.

For bonus points, we should consider this:

      XTWINOPS 2 2  (save/push title) and 2 3  (restore/pop title)
      accept an optional third parameter for direct access to the
      stack.  Parameters in the range 1 through 10, may be used to
      store the title into the stack or retrieve the title from the
      stack without pushing/popping.

cc @lilyball

Metadata

Metadata

Assignees

No one assigned

    Labels

    vtControl sequence related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions