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: Wed, 13 Aug 2008 23:55:40 +0200 Message-ID: <48A3585C.9010208@alice.it> References: <48A198B6.4080206@alice.it> <48A1F73E.4040504@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 1218664589 12706 80.91.229.12 (13 Aug 2008 21:56:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 21:56:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 13 23:57:21 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 1KTOLD-0006Eq-RS for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2008 23:57:16 +0200 Original-Received: from localhost ([127.0.0.1]:49772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTOKH-0001bn-GO for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2008 17:56:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTOKC-0001bR-NX for emacs-devel@gnu.org; Wed, 13 Aug 2008 17:56:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTOKB-0001ay-C0 for emacs-devel@gnu.org; Wed, 13 Aug 2008 17:56:12 -0400 Original-Received: from [199.232.76.173] (port=48457 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTOKB-0001av-82 for emacs-devel@gnu.org; Wed, 13 Aug 2008 17:56:11 -0400 Original-Received: from smtp-out25.alice.it ([85.33.2.25]:3049) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTOKA-0001Fv-Mb for emacs-devel@gnu.org; Wed, 13 Aug 2008 17:56:10 -0400 Original-Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Aug 2008 23:56:08 +0200 Original-Received: from FBCMCL01B05.fbc.local ([192.168.69.86]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Aug 2008 23:56:07 +0200 Original-Received: from [87.6.222.18] ([87.6.222.18]) by FBCMCL01B05.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Aug 2008 23:56:07 +0200 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: X-OriginalArrivalTime: 13 Aug 2008 21:56:07.0864 (UTC) FILETIME=[63EC4B80:01C8FD8F] 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:102422 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 $ > > I do not doubt it. They are codes meant specifically for those > terminal emulators so it's no wonder they do what you want there. No! They are codes (escape sequences) for BASH shell. Many people use different shells (zsh, tcsh,...) which have different syntax. > Try it on a wyse terminal, or in the Linux console. M-x shell is not > a terminal Sorry, but I have already cited GNU/Linux and KDE-Konsole! on which there is the same problem!... and have sent another post [1]. I have pointed this problem because I think that M-x shell does not interpret correctly some escape/code; googling or searching in help-emacs, shows this is an acient problem whose workarounds do not seem to work with 23 (and 22?). Obviously that is only my opinion. Angelo > emulator. M-x term is more likely to do what you want (tho I do not > guarantee that all those escape sequences are supported, especially > the one that sets the window title). --- [1] http://lists.gnu.org/archive/html/emacs-devel/2008-08/msg00556.html