delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/25/09:02:09

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <ebb9 AT byu DOT net>
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: <d1v41l$kii$1 AT sea DOT gmane DOT org> <4243160C DOT 7040503 AT buddydog DOT org> <d1v5e8$p5i$1 AT sea DOT gmane DOT org> <loom DOT 20050325T001858-298 AT post DOT gmane DOT org> <d20e6q$rk5$1 AT sea DOT gmane DOT org> <4243C536 DOT 43CBA6C4 AT dessent DOT net>
In-Reply-To: <4243C536.43CBA6C4@dessent.net>
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
> <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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019