Subject: Re: rxvt problem: Prompt doesn't look very nice
From: Brian Dessent <[email-masked]>
To: [email-masked]
Date: Fri, 25 Mar 2005 00:00:54 -0800

Mikael wrote:

> Thanks Michael. I am using the CVS-version (dated early febraury) of Emacs.
> I removed the lines I added to my .bashrc and added what you showed to my
> .emacs. Now my bash shell inside emacs looks nice (and in color), but it's
> not perfect. Here it is:
> 
> ]0;c:/cygwin/home/mikael/coding/Win32/show_styles/src
> mikael@mindcooler c:/cygwin/home/mikael/coding/Win32/show_styles/src
> $
> 
> The first line doesn't look so good and it's basically repeating what's in
> the second line (the path).

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$ '

The part that sets the window title is "\033]0;\w\007", so you would
want

PS1='\n\[\033[32m\]\u@\h \[\033[33m\w\033[0m\]\n$ '

Note that '\[' and '\]' are pseudo-escape sequences that tell bash that
the enclosed characters represent an escape sequence that the terminal
will interpret and not print.  They are used so that bash will know to
not include those characters in calculating the cursor position.

If you want to change the colors, the number N in "\033[Nm" is what to
modify.  See google or
<http://www.dee.ufcg.edu.br/~rrbrandt/tools/ansi.html> for more details.

Brian

--
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/