backup terminal title

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

On Sat, 6 Feb 2010, perryh at wrote:

> Warren Block <wblock at> 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

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