help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls lists funky names within M-x shell


From: John Paul Wallington
Subject: Re: ls lists funky names within M-x shell
Date: Sat, 11 Feb 2006 01:51:13 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Doug Morris <dougbmorris@yahoo.com> writes:

> Anyone know why I get garbage with my file names (e.g. [01;34mcvs^[[0m)
> using ls within the shell from M-x shell?  For example:
>
> doug@gladyce ~/keep/dev/javagui/cmd $ ls -l
> ^[[0mtotal 24
> -rwxr-xr-x  1 doug users 1196 Jan 25 15:40 ^[[01;32mcompile^[[0m
[...]

They are SGR control codes that typically represent colours.  Your ls
program is presently configured to output these sequences -- you
probably see colourful listings using ls in an xterm or at the
console.  To display the colours within Emacs for all comint-based
modes including `shell-mode' you can add:

(ansi-color-for-comint-mode-on)

to your .emacs file.

If you would rather it only applied to `shell-mode' buffers then you
could add:

(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

instead.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]