[Techtalk] Changing the titlebar on an xterm

Akkana Peck akkana at shallowsky.com
Fri May 2 02:06:30 UTC 2014

Carol Williams writes:
> I've always done something like this:
> for the .bashrc
> PS1="\[\033]0;\u@\h:  \w\007\]bash\\$  "

John Clarke writes:
>     PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
> >   echo -e "\033]2; $* \007"
> I use 'echo -ne "\033]0;$@\007"', but your version works too, as does
> "xtermset -T" and "xtermcontrol --title".  I'm running xterm-278-1ubuntu3
> on Mint 16.  The same commands work in gnome-terminal too.

Thanks to both of you! It turns out I had two problems. First, the
sequence that all the howtos give, <ESC>]2, doesn't work at all for
me (still). But you're both using 0, not 2, as the command, so I
switched to testing using that.

Second, I had this X resource set:
XTerm*allowSendEvents: true

I don't remember why I had that set, but apparently it has a side
effect of disabling titlebar changes (now, though I don't think it
did originally).

Changing that, and changing my alias to use <ESC>]0 instead of
<ESC>]2, looks like it's done the trick.

Looks like I can happily set my titlebar again!


More information about the Techtalk mailing list