Mail Archives: cygwin/2005/03/25/09:02:09
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Brian Dessent on 3/25/2005 1:00 AM:
>
> The first line above of PS1 is an escape sequence that tells the
> terminal to change the window title to the given string. Emacs
> apparently does not support that escape sequence, so you'll have to
> modify your prompt. The Cygwin default is
>
> PS1='\[\033]0;\w\007\n\033[32m\]\u@\h \[\033[33m\w\033[0m\]\n$ '
And this is an evil default in /etc/profile, because it does not correctly
delineate printing vs non-printing characters, and hence messes up bash in
computing prompt width. Can we please get base-files updated, to
actually use \[ and \] only around non-printing characters? Also, bash
supports \e for \033, and \a for \007, and uses \$ to print $ for normal
users vs # for root (man bash, search for PROMPTING for other cool escape
sequences). I would prefer the cygwin default for bash to be:
PS1='\[\e]0;\w\a\e[32m\]\n\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
> See google or
> <http://www.dee.ufcg.edu.br/~rrbrandt/tools/ansi.html> for more details.
That page only covered ANSI sequences, or "\e[...". It did not cover
xterm sequences, or "\e]..." See
http://networking.ringofsaturn.com/Unix/Bash-prompts.php for details on
setting the xterm title and icon using "\e]0;...\a", "\e]1;...\a", and
"\e]2;...\a". This page also recommends examining $TERM before setting
PS1 to use \e]..., since it those escapes work when TERM is cygwin or
xterm, but don't work when it is emacs or vt100.
- --
Life is short - so eat dessert first!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCRBm984KuGfSFAYARAud7AJ9bgnHlTxmLgKIyXq/PRLHZuV89kQCgp3Ro
fs9h4RYoIRUes1Ks054C1HE=
=ETk0
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -