|
From: | Angelo Graziosi |
Subject: | Re: On prompt in shell mode |
Date: | Wed, 13 Aug 2008 12:03:52 +0200 |
User-agent: | Thunderbird 2.0.0.16 (Windows/20080708) |
Chong Yidong ha scritto:
Angelo Graziosi <address@hidden> 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 address@hidden ^[[33m~/downloads/cygwinports^[[0m $ being echo PS1 \[\e]0;address@hidden \[\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='address@hidden \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='address@hidden \[\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" "address@hidden \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.
[Prev in Thread] | Current Thread | [Next in Thread] |