Setting window title via escape sequences

187 views
Skip to first unread message

Chris Sutcliffe

unread,
Jun 25, 2009, 11:38:54 PM6/25/09
to mintty-...@googlegroups.com
.... is it possible?

I've tried:

echo -ne "\e]2;%n@%m: %~\a"

which according to http://www.faqs.org/docs/Linux-mini/Xterm-Title.html, should:

- ESC]2;stringBEL -- Set window title to string

and:

%n expands to $USERNAME
%m expands to hostname up to first '.'
%~ expands to directory, replacing $HOME with '~'

Am I doing something wrong, or perhaps this isn't implemented?

Chris

--
Chris Sutcliffe
http://emergedesktop.org

Chris Sutcliffe

unread,
Jun 25, 2009, 11:41:59 PM6/25/09
to mintty-...@googlegroups.com
> I've tried:
>
> echo -ne "\e]2;%n@%m: %~\a"

This is for zsh, the bash equivalent is:

echo -ne "\e]2;${USER}@${HOSTNAME}: ${PWD}\a"

Chris Sutcliffe

unread,
Jun 25, 2009, 11:43:41 PM6/25/09
to mintty-...@googlegroups.com
Bah... never mind, my PS1 prompt was resetting the title....

sorry for the noise.

Reply all
Reply to author
Forward
0 new messages