backup terminal title

Thomas Dickey dickey at
Sat Feb 6 13:14:16 UTC 2010

On Sat, Feb 06, 2010 at 01:38:11PM +0100, Dominic Fandrey wrote:
> I just started to wonder how portmaster changes the window title
> of my terminal and why it doesn't change it back when it
> terminates.
> Some digging in the portmaster code showed up an escape sequence:
> printf "\033]0;%s\007" "YOUR TEXT GOES HERE"
> Unfortunately I am entirely clueless as to how one could backup
> the old title string to restore it upon termination. It seems
> to me this ought to be a precondition to using this kind of
> feature.

It "can", depending - some people object to the control sequence which
can retrieve the previous value.  I added a push/pop stack for xterm last
year which can work around that (transparently).  I used that in vile
(vi like emacs), and I made a fix for 'screen' which uses it.


For other terminals - some have disabled the objectionable feature,
some have not.  (Some will eventually copy the push/pop feature ;-)

Thomas E. Dickey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list