unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Shell prompt messed up
@ 2011-02-05 19:12 Michael Kirsch
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kirsch @ 2011-02-05 19:12 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

The prompt in the shell (the one that comes up when I enter M-x shell) isn't
right.

My normal prompt looks like this, and is colored bright green using ANSI
escape codes:

username:directory$

But the prompt looks like this in Emacs:

^[]0;username@hostname:/full/path/to/directory^Gusername:directory$

The part after the ^G looks like my normal prompt, and still has the bright
green color. The ^[ and ^G are highlighted, so I guess they are
non-printable chars. The part between the ^[ and ^G is dark blue.

How do I fix it?

[-- Attachment #2: Type: text/html, Size: 580 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Shell prompt messed up
       [not found] <mailman.13.1296938767.12531.help-gnu-emacs@gnu.org>
@ 2011-02-06 20:17 ` J
  0 siblings, 0 replies; 2+ messages in thread
From: J @ 2011-02-06 20:17 UTC (permalink / raw)
  To: help-gnu-emacs

Have you tried this:

by default, Emacs Shell will just print out those ASCII control
codes.

The omniscient Google pointed out that Emacs can be told to interpret
those control codes instead of just printing them out.

Two ways to do it:
  * Within Emacs Shell, M-x ansi-color-for-comint-mode-on, or
  * Append (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
   to ${HOMEDIR}/.emacs.

HTH. HAND


Michael Kirsch <mkirsch358@gmail.com> wrote:
> [-- text/plain, encoding 7bit, charset: ISO-8859-1, 18 lines --]
> 
> The prompt in the shell (the one that comes up when I enter M-x shell) isn't
> right.
> 
> My normal prompt looks like this, and is colored bright green using ANSI
> escape codes:
> 
> username:directory$
> 
> But the prompt looks like this in Emacs:
> 
> ^[]0;username@hostname:/full/path/to/directory^Gusername:directory$
> 
> The part after the ^G looks like my normal prompt, and still has the bright
> green color. The ^[ and ^G are highlighted, so I guess they are
> non-printable chars. The part between the ^[ and ^G is dark blue.
> 
> How do I fix it?
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-06 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.13.1296938767.12531.help-gnu-emacs@gnu.org>
2011-02-06 20:17 ` Shell prompt messed up J
2011-02-05 19:12 Michael Kirsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).