From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: "Lorenzo Isella" <lorenzo.isella@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 12:59:47 +0200 [thread overview]
Message-ID: <87fxnjjjz0.fsf@tux.homenetwork> (raw)
In-Reply-To: <a2b3004b0809290348x5f554eebw9c89c154b28e98d8@mail.gmail.com> (Lorenzo Isella's message of "Mon, 29 Sep 2008 12:48:53 +0200")
"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
next prev parent reply other threads:[~2008-09-29 10:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-28 19:27 Emacs Shell Ansi Colors Lorenzo Isella
2008-09-28 21:19 ` Thierry Volpiatto
[not found] ` <F725F550-369F-4C9A-BACA-D13E30D70FC2@Web.DE>
2008-09-29 10:48 ` Lorenzo Isella
2008-09-29 10:59 ` Thierry Volpiatto [this message]
2008-09-29 12:37 ` Paul R
2008-09-29 12:45 ` Paul R
2008-09-29 13:02 ` Lorenzo Isella
2008-09-29 13:40 ` Paul R
2008-09-29 14:32 ` Lorenzo Isella
[not found] ` <mailman.20145.1222693383.18990.help-gnu-emacs@gnu.org>
2008-09-29 13:32 ` Andreas Politz
2008-09-29 16:08 ` Peter Dyballa
[not found] ` <mailman.20143.1222686216.18990.help-gnu-emacs@gnu.org>
2008-09-29 14:14 ` Richard Riley
[not found] ` <mailman.20146.1222694164.18990.help-gnu-emacs@gnu.org>
2008-09-29 14:22 ` Richard Riley
2008-09-29 14:57 ` Paul R
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fxnjjjz0.fsf@tux.homenetwork \
--to=thierry.volpiatto@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=lorenzo.isella@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).