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

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

Re: Emacs Shell Ansi Colors


From: Thierry Volpiatto
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 12:59:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

"Lorenzo Isella" <lorenzo.isella@gmail.com> writes:

> 2008/9/29 Peter Dyballa <Peter_Dyballa@web.de>:
>>
>> Am 28.09.2008 um 23:19 schrieb Thierry Volpiatto:
>>
>>> ,----
>>> | (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
>>> | (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
>>> `----
>>
>>
>> For me
>>
>>        (ansi-color-for-comint-mode-on)
>>
>> is enough ...
>>
>> --
>> Greetings
>>
>>  Pete
>>
>> There's no place like ~
>>                – (UNIX Guru)
>>
>>
>>
>>
>
>
>
> Hi,
> And thanks for your suggestions. I am puzzled since I gave both a try
> (actually one of them is precisely the same recommendation from the
> wiki page), but the problem stays the same.
>>From the web
> http://www.emacswiki.org/cgi-bin/wiki/ansi-color.el
> I read
>
> ;;; Commentary:
>
> ;; This file provides a function that takes a string or a region
> ;; containing Select Graphic Rendition (SGR) control sequences (formerly
> ;; known as ANSI escape sequences) and tries to translate these into
> ;; faces.
> ;;
> ;; This allows you to run ls --color=yes in shell-mode.  In order to
> ;; test this, proceed as follows:
> ;;
> ;; 1. start a shell: M-x shell
> ;; 2. load this file: M-x load-library RET ansi-color RET
> ;; 3. activate ansi-color: M-x ansi-color-for-comint-mode-on
> ;; 4. test ls --color=yes in the *shell* buffer
> ;;
> ;; Note that starting your shell from within Emacs might set the TERM
> ;; environment variable.  The new setting might disable the output of
> ;; SGR control sequences.  Using ls --color=yes forces ls to produce
> ;; these.
> ;;
> ;; If you decide you like this, add the following to your .emacs file:
> ;;
> ;; (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
> ;; (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
>
> So it looks like there could be a problem with the TERM environment
> variable (but do not ask me what this stands for).
> I suppose (hope?) this is a one-liner for somebody really
> knowledgeable about emacs.
> Kind Regards
>
> Lorenzo
>
ansi-color.el is part of emacs, it will be loaded with emacs, so you
have nothing to do with that.

Also:
be sure you have something like that in your .bashrc:

,----
| if [[ -f ~/.dir_colors ]]; then
|       eval `dircolors -b ~/.dir_colors`
| else
|       eval `dircolors -b /etc/DIR_COLORS`
| fi
`----
(Assume you have such a file)

The best is to have a per-user file : "~/.dir_colors"
Just copy it from /etc

You can also add this line in this file:

,----
| TERM dumb
`----

And now with the code i sent in precedent post or the code Peter sent,
it should work.

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France




reply via email to

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