[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On prompt in shell mode

From: Angelo Graziosi
Subject: Re: On prompt in shell mode
Date: Tue, 12 Aug 2008 22:49:02 +0200
User-agent: Thunderbird (Windows/20080708)

Stefan Monnier ha scritto:
The following regards Emacs (trunk) both on Linux and Cygwin.

When I do: M-x shell, the prompt has garbage:

address@hidden ^[[33m~/downloads/cygwinports^[[0m


echo PS1
\[\e]0;address@hidden \[\e[33m\]\w\[\e[0m\]\n\$

Doesn't look like garbage to me: it looks like the exact (garbage) codes
specified in your PS1.  After all \e is ^[ and \a is ^G (IIRC).

You should be careful to choose the escape sequences in your PS1
according to the escape sequences accepted by the terminal emulator in
which the shell is running (which is reflected in the $TERM envvar).

Obviously, what you call "the exact (garbage) codes specified in your PS1" in RXVT, MRXVT, URXVT, (KDE)Konsole produces:

address@hidden ~/downloads/cygwinports

in which 'address@hidden' is in green, '~/downloads/cygwinports' in yellow and '$' white.

It is only in Emacs shell mode (M-x shell) it produces 'garbage', both in GNU/Linux and Cygwin builds of current trunk.

Is there a method to redefine PS1 in .emacs?


'address@hidden \w\n $'

for PS1 would be enough.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]