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 12:03:52 +0200 Message-ID: <48A2B188.40604@alice.it> References: <48A198B6.4080206@alice.it> <87sktaw0y1.fsf@stupidchicken.com> 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 1218621911 26101 80.91.229.12 (13 Aug 2008 10:05:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2008 10:05:11 +0000 (UTC) Cc: emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 13 12:06:03 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 1KTDEw-0003Dx-4N for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2008 12:06:02 +0200 Original-Received: from localhost ([127.0.0.1]:46277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTDDz-0002J1-Nf for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2008 06:05:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTDDM-00026b-LR for emacs-devel@gnu.org; Wed, 13 Aug 2008 06:04:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTDDL-00025r-54 for emacs-devel@gnu.org; Wed, 13 Aug 2008 06:04:24 -0400 Original-Received: from [199.232.76.173] (port=51141 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTDDK-00025m-OX for emacs-devel@gnu.org; Wed, 13 Aug 2008 06:04:22 -0400 Original-Received: from smtp-out28.alice.it ([85.33.2.28]:2320) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTDDK-0008UB-6y for emacs-devel@gnu.org; Wed, 13 Aug 2008 06:04:22 -0400 Original-Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out28.alice.it with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Aug 2008 12:04:19 +0200 Original-Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Aug 2008 12:04:19 +0200 Original-Received: from [87.10.222.241] ([87.10.222.241]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Wed, 13 Aug 2008 12:01:06 +0200 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <87sktaw0y1.fsf@stupidchicken.com> X-OriginalArrivalTime: 13 Aug 2008 10:01:06.0140 (UTC) FILETIME=[8080B9C0:01C8FD2B] 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:102401 Archived-At: Chong Yidong ha scritto: > Angelo Graziosi writes: > >> 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\$ >> >> I have found [1], for which 'ansi-color-for-comint-mode-on' should fix >> the thing. I have also tried defining PS1='PROMPT>' or PS1='\n\u@\h >> \w\n$ ' in .emacs_bash, but in all cases there is still garbage after >> M-x shell. >> >> So I would ask if you have a better solutions. > > I'm unable to reproduce this; ansi-color-for-comint-mode-on works for me > with that exact prompt. Ok. Now I have discovered that the sequence: \[\e]0;\w\a\] is the cause even using 'ansi-color-for-comint-mode-on'. Indeed defining PS1='\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' works just fine with 'ansi-color-for-comint-mode-on'. For completeness '\[\e]0;\w\a\]' sets the window title. I have also tried to add (setenv "PS1" "...") in .emacs: (setenv "PS1" "prompt>") works, but (setenv "PS1" "\n\u@\h \w\n$ ") causes Emacs to start with errors: "An error has occurred while loading '[...]/.emacs': error: Non-hex digit used for Unicode escape" How could this problem be solved? Thanks a lot, Angelo.