all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Riley <rileyrgdev@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 16:14:43 +0200	[thread overview]
Message-ID: <gbqnrd$kie$1@registered.motzarella.org> (raw)
In-Reply-To: mailman.20143.1222686216.18990.help-gnu-emacs@gnu.org

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?


  parent reply	other threads:[~2008-09-29 14:14 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
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 [this message]
     [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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gbqnrd$kie$1@registered.motzarella.org' \
    --to=rileyrgdev@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.