From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: Emacs Shell Ansi Colors Date: Mon, 29 Sep 2008 16:14:43 +0200 Organization: A noiseless patient Spider Message-ID: References: <48DFDAB9.5020506@gmail.com> <87prmo3r45.fsf@tux.homenetwork> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1222699326 24655 80.91.229.12 (29 Sep 2008 14:42:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Sep 2008 14:42:06 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 29 16:43:04 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KkJxI-0001tX-GU for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Sep 2008 16:42:32 +0200 Original-Received: from localhost ([127.0.0.1]:51187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkJwF-0002k0-PY for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Sep 2008 10:41:27 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!news.motzarella.org!motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 105 Original-X-Trace: feeder.motzarella.org U2FsdGVkX18q240gLMCvZNxIKbkinfDV1gr9DaeVL0eqLo2e3lFDUV78Jn+Tdu1kSLvEB6tYm55WoHVgrMQtMfbYszK2yqSlW2MVLxNRzVf7vuCmkyVOvgwn2lg/340uS6ACZeSm+r0EC3cECz57iA== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Mon, 29 Sep 2008 14:14:05 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/RoCiJQ0d7mPkfK4wYjidAmaaeYywwK3hvaufITdn+Zw== Cancel-Lock: sha1:ruG+7KT+jEW6JU6k8mARTVeS0Zg= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:162845 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58188 Archived-At: Thierry Volpiatto writes: > "Lorenzo Isella" writes: > >> 2008/9/29 Peter Dyballa : >>> >>> 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?