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: Richard Riley
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 16:14:43 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> "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.

I just noticed that I have the alias for my ls --color=auto in my bashrc
but the emacs shell does not pick it up in debian. So maybe another rc
file needs this stuff?


reply via email to

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