Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <424419BD.9040005@byu.net> Date: Fri, 25 Mar 2005 07:01:33 -0700 From: Eric Blake User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: rxvt problem: Prompt doesn't look very nice References: <4243160C DOT 7040503 AT buddydog DOT org> <4243C536 DOT 43CBA6C4 AT dessent DOT net> In-Reply-To: <4243C536.43CBA6C4@dessent.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes -----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 > 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/