[nSLUG] Screen's caption

Daniel Morrison draker at gmail.com
Tue Sep 22 10:13:39 ADT 2009

2009/9/22 Mike.lifeguard <mike.lifeguard at gmail.com>:
> Daniel Morrison wrote:
>> What does this part do?
>>  \[\e]0;\u@\H: \w\a\]
> Everything between the \[ and \] is unprintable (so it doesn't appear in
> the prompt). Instead, the \e]0; sends it to the titlebar of your
> terminal emulator's window (if there is one).
> So, it is basically the same as the actual prompt, shown in another
> place. The \H is the full hostname, while \h is only the first part
> (there is more room to display in the titlebar than in the prompt).


I'm getting too forgetful. "But I have my titlebar set!" I think. "How
did I do that?"

local TITLEBAR='\[\e]0;\u@\h:\w\$\a\]'
PS1="${TITLEBAR}\u@\h:\w\$ "

Whaddya know...


More information about the nSLUG mailing list