From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Angelo Graziosi Newsgroups: gmane.emacs.devel Subject: Re: On prompt in shell mode Date: Tue, 12 Aug 2008 22:49:02 +0200 Message-ID: <48A1F73E.4040504@alice.it> References: <48A198B6.4080206@alice.it> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218574202 3925 80.91.229.12 (12 Aug 2008 20:50:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Aug 2008 20:50:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 12 22:50:52 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KT0pL-0006FI-R7 for ged-emacs-devel@m.gmane.org; Tue, 12 Aug 2008 22:50:48 +0200 Original-Received: from localhost ([127.0.0.1]:55957 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KT0oM-00030A-6J for ged-emacs-devel@m.gmane.org; Tue, 12 Aug 2008 16:49:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KT0oI-0002xn-Jc for emacs-devel@gnu.org; Tue, 12 Aug 2008 16:49:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KT0oC-0002p6-Fh for emacs-devel@gnu.org; Tue, 12 Aug 2008 16:49:41 -0400 Original-Received: from [199.232.76.173] (port=51054 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KT0oC-0002ov-BU for emacs-devel@gnu.org; Tue, 12 Aug 2008 16:49:36 -0400 Original-Received: from smtp-out26.alice.it ([85.33.2.26]:1181) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KT0oB-0001XV-Kg for emacs-devel@gnu.org; Tue, 12 Aug 2008 16:49:36 -0400 Original-Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.1830); Tue, 12 Aug 2008 22:49:27 +0200 Original-Received: from FBCMCL01B01.fbc.local ([192.168.69.82]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 12 Aug 2008 22:49:27 +0200 Original-Received: from [87.6.212.129] ([87.6.212.129]) by FBCMCL01B01.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Tue, 12 Aug 2008 22:49:27 +0200 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: X-OriginalArrivalTime: 12 Aug 2008 20:49:27.0342 (UTC) FILETIME=[E90354E0:01C8FCBC] X-detected-kernel: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102381 Archived-At: Stefan Monnier ha scritto: >> The following regards Emacs (trunk) both on Linux and Cygwin. > >> When I do: M-x shell, the prompt has garbage: > >> ^[]0;~/downloads/cygwinports^G >> ^[[32mangelo@host ^[[33m~/downloads/cygwinports^[[0m >> $ > >> being > >> echo PS1 >> \[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\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: angelo@host ~/downloads/cygwinports $ in which 'angelo@host' 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? Using '\n\u@\h \w\n $' for PS1 would be enough. Cheers, Angelo.