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

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
To: cygwin AT cygwin DOT com
From: "Mikael" <mindcooler AT gmail DOT com>
Subject: Re: rxvt problem: Prompt doesn't look very nice
Date: Fri, 25 Mar 2005 08:22:26 +0100
Lines: 93
Message-ID: <d20e6q$rk5$1@sea.gmane.org>
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>
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: 180.184.204.213.sol.worldonline.se
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Original
X-Gmane-MailScanner: Found to be clean
X-Gmane-MailScanner: Found to be clean
X-MailScanner-From: goc-cygwin AT m DOT gmane DOT org
X-MailScanner-To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

"Michael Mauger" wrote:
> Mikael writes:
>> "Jonathan Arnold" wrote:
>> > Mikael wrote:
>> >> Hello, I just tried rxvt because I wanted to replace the hopeless cmd
>> >> window. However, the "prompt" (not sure that is the correct word) 
>> >> doesn't
>> >> look very nice, here it is copied and pasted:
>> >> \[\033]0;\w\007
>> >> \033[32m\]\u <at> \h \[\033[33m\w\033[0m\]
>> >> $
>> >> It looks similar, if not the same, as the result when I tried to set 
>> >> bash
>> >> as the default shell for a native Windows Emacs cvs version. I guess 
>> >> the
>> >> \[\033]0;\w\007
>> >> \033[32m\]\u <at> \h \[\033[33m\w\033[0m\] should display the cwd if 
>> >> it
> was
>> >> working correctly, yes?
>> >
>> > These are ansi escape sequences, which won't work "inside" emacs, 
>> > because
>> > it isn't an ANSI terminal.
>> >
>>
>> I really really hope that someone makes it work some day (I wish I had 
>> the
>> knowledge to contribute), because it's on my top-three list of 
>> outstanding
>> issues I have with Cygwin (admittedly indirectly in this case because I 
>> use
>> a native Emacs version). My other issues mostly revolve around being 
>> unable
>> to build certain program ootb on cygwin.
>>
>
> If you are using Emacs >=21.1; try the following elisp
>   (add-hook 'comint-mode-hook 'ansi-color-for-comint-mode-on)
>
> You should see the colors properly in emacs.  (Essentially Emacs 
> interprets the
> escape sequences and emulates them with the appropriate emacs features.)
>

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).

How do I make it perfect?

>> > As for rxvt, those should work just fine.  See this FAQ for a little 
>> > bit
>> > more info and a pointer to the rxvt docs:
>> >
>> > http://cygwin.com/faq/faq_3.html#SEC65
>> >
>> > -- 
>>
>> Thanks for the link, now it looks much better. Now I just need to find a
>> font I like. Thanks for replying so quickly Jonathan with such excellent
>> help, it helps make this world a kinder place.
>>
>
> Are you sure you are using `bash' as your shell?  The ability to use 
> "visible"
> escape sequences for colors et al. rather than the actual control 
> characters in
> the prompt variables is a `bash' feature.  I see what you are seeing when 
> I use
> `sh' or `ksh' and have the `bash'-style prompt settings.
>
> The reason I think this is that `bash' would not write out the \[ and \]
> sequences as part of the prompt.  These are fenceposts used to identify
> portions of the prompt string that take up no physical space on the output
> line.  This permits `bash' to calculate how long the prompt string 
> actually is
> so that wrapping and editting look correct.
>
>

/ M 




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