From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Emacs Shell Ansi Colors Date: Mon, 29 Sep 2008 12:59:47 +0200 Message-ID: <87fxnjjjz0.fsf@tux.homenetwork> 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: quoted-printable X-Trace: ger.gmane.org 1222686672 13510 80.91.229.12 (29 Sep 2008 11:11:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Sep 2008 11:11:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Lorenzo Isella" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 29 13:12:10 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 1KkGff-0001KG-0c for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Sep 2008 13:12:07 +0200 Original-Received: from localhost ([127.0.0.1]:53228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkGeZ-00031T-Jw for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Sep 2008 07:10:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkGXN-0004fh-T9 for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 07:03:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkGXL-0004eO-PE for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 07:03:32 -0400 Original-Received: from [199.232.76.173] (port=48371 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkGXL-0004e6-G0 for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 07:03:31 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.188]:53895) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KkGXL-0006JS-2d for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 07:03:31 -0400 Original-Received: by nf-out-0910.google.com with SMTP id c7so704298nfi.26 for ; Mon, 29 Sep 2008 04:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=+czghkugnDfSXvyJN7R7QbhRNuDP4k+pPMIXsMXzlFo=; b=t1wvE/wnzEPXMN10BD1eQAX/yQqkj5V1U1FPwudZ5oBLYoVK5s6WWkGg3v710Hpgey sHjgOdwNgqiwwwrTEwMa4UTRmbL9sejFNhAJa6WpEssTV7Kl8ogUIg69j5UAVXY3zNEv Zbo96DUrx5/d7kiqxlG+ECThFiszLRAQFtT60= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; b=tKreMdKwcLjY7uojeFKhPr+EqNulf51vturAvbRhRgaNaIB/seo4wbS+XAWG0BBwZQ Ua4tBJdl0aQeva/Xudi/PouHk7nMgMTXqXp+65H+w/LUkG3TphYTDIqqltND2F9siqD8 NkXLBv/zzecyXnGiggdunw5CpvLXBNDvOxF1Q= Original-Received: by 10.210.116.14 with SMTP id o14mr6091167ebc.8.1222686209797; Mon, 29 Sep 2008 04:03:29 -0700 (PDT) Original-Received: from tux.homenetwork (9.77.197-77.rev.gaoland.net [77.197.77.9]) by mx.google.com with ESMTPS id z34sm11435ikz.3.2008.09.29.04.03.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Sep 2008 04:03:28 -0700 (PDT) In-Reply-To: (Lorenzo Isella's message of "Mon, 29 Sep 2008 12:48:53 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:58177 Archived-At: "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 ~ >> =E2=80=93 (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=3Dyes 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=3Dyes 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=3Dyes 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. --=20 A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France