backup terminal title

Warren Block wblock at wonkity.com
Sun Feb 7 07:18:03 UTC 2010


On Sat, 6 Feb 2010, perryh at pluto.rain.com wrote:

> Warren Block <wblock at wonkity.com> wrote:
>> What's the sequence for reading the terminal title?
>
> If I remembered it I'd have included it :)

I did some unsuccessful searching for "query xterm title" earlier today.

> The first 3 results from Googling "xterm escape sequences" are
>
>  rtfm.etla.org/xterm/ctlseq.html

That one has it:

printf "\033];badexample\007"

This sets the title in both xterm and Terminal.

printf "\033[21;t\n"

That brings back the title in Terminal, with a leading "l"... and in the 
keyboard buffer.  Doesn't work in xterm, possibly because xterm is 
pickier about the exact sequence.

-Warren Block * Rapid City, South Dakota USA


More information about the freebsd-questions mailing list