How to set terminal title 'dynamically'? (i.e. what's the esc sequence?)
Chris Green
cl at isbd.net
Mon Jun 25 23:00:58 CEST 2012
On Mon, Jun 25, 2012 at 08:31:47AM +0200, suvayu ali wrote:
> 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>'
>
... but the issue is that it doesn't actually work if you happen to have
set the title already with a --title=XXXX when starting the terminal.
So all the stuff about putting the "Dynamically set title" before or
after the initial title is rubbish as you can't put it anywhere.
--
Chris Green
More information about the Xfce
mailing list