How to set terminal title 'dynamically'? (i.e. what's the esc sequence?)

suvayu ali fatkasuvayu+linux at gmail.com
Mon Jun 25 08:31:47 CEST 2012


Hi,

On Sun, Jun 24, 2012 at 5:12 PM, Warren Block <wblock at wonkity.com> wrote:
>>
>> So, how do I do this?  The xfce4-terminal help tells me it *can* be done
>> as it talks about how to position the "Dynamically set title" but I
>> can't see anywhere that it tells me *how* to put text in the title bar.
>
>
> For completeness:
>  printf "\033];Funny Title\007"

As far as I know one has to do this from the shell by customising the
prompt. For bash, you can enclose whatever text you want within two
special escape characters: \e]2; ... \a (this is probably the same as
above). To prevent bash from getting confused while wrapping command
lines, you should enclose it in \[ \].

There are many escape sequences that expand to useful text can be put
there. You can find the complete documentation in the manual page for
your shell (man bash, prompting for bash). I use the following
customisation in my ~/.bashrc:

  export PS1='\[\e]2;\u@\H:\w\a\] <other stuff>'

HTH

-- 
Suvayu

Open source is the future. It sets us free.


More information about the Xfce mailing list