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

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: <4243C536.43CBA6C4@dessent.net>
Date: Fri, 25 Mar 2005 00:00:54 -0800
From: Brian Dessent <brian AT dessent DOT net>
Organization: My own little world...
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>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

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

- Raw text -


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