From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lorenzo Isella" Newsgroups: gmane.emacs.help Subject: Re: Emacs Shell Ansi Colors Date: Mon, 29 Sep 2008 16:32:37 +0200 Message-ID: References: <48DFDAB9.5020506@gmail.com> <87prmo3r45.fsf@tux.homenetwork> <87abdr9l3v.fsf@gmail.com> <8763of9ikm.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222698792 22583 80.91.229.12 (29 Sep 2008 14:33:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Sep 2008 14:33:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Thierry Volpiatto To: "Paul R" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 29 16:34: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 1KkJp8-00078N-0f for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Sep 2008 16:34:06 +0200 Original-Received: from localhost ([127.0.0.1]:60475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkJo5-0004Wi-B9 for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Sep 2008 10:33:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkJnk-0004WQ-Jf for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 10:32:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkJni-0004Vp-QM for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 10:32:40 -0400 Original-Received: from [199.232.76.173] (port=35968 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkJni-0004Ve-LW for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 10:32:38 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.187]:20685) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KkJni-0001Ak-Fz for help-gnu-emacs@gnu.org; Mon, 29 Sep 2008 10:32:38 -0400 Original-Received: by nf-out-0910.google.com with SMTP id c7so746924nfi.26 for ; Mon, 29 Sep 2008 07:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=91EekqnoJhk6dFzbQpR1YmiGzUTFkTcEzSCT6/O1a1w=; b=LhLOAhmJqu0E0CozQGl7Q/hQ9Of6xP/Y/rtYHeL3R7BnbSA491QMf2/rSXFc6WJjr5 HoAowbihHIXQIcCCvcqyvjGB5NEJ9IQ/DX6cUOyCXvzTal017hUmjp08H3SnHhUGMHYA hmBtDCicpFnhTyuu9rhWk6G4G3YcI/93UEPtM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=U1KRW5LPM1W1mp4Mf9Tc/lBIzPMnffiEAXGgdSYP2AX0j2s5v9f02EUJjLI4bYx62E bv/Fu3gLYpP2iBPu0cABy0gw7/jZwcP+g5+KjiKE5vhpcHdcRIZFif4IC6e5BZzN5IQM Vtm+hgMG3SMKJbC8DN7nwOzsXRvfFbZIxwCKg= Original-Received: by 10.210.133.2 with SMTP id g2mr6340720ebd.68.1222698757339; Mon, 29 Sep 2008 07:32:37 -0700 (PDT) Original-Received: by 10.210.11.3 with HTTP; Mon, 29 Sep 2008 07:32:37 -0700 (PDT) In-Reply-To: <8763of9ikm.fsf@gmail.com> Content-Disposition: inline X-Google-Sender-Auth: 12b34957390f2ee4 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:58186 Archived-At: Perfect! Just to finish off this thread, here is the output of $ env | grep TERM TERM=dumb TERMCAP= COLORTERM=gnome-terminal This time ran from within emacs. I had neither file ~/.emacs_bash nor ~/.emacs.d/init_bash.sh, but creating ~/.emacs.d/init_bash.sh with the only content alias ls='ls --color' followed by a blank line (precisely as you said) got the job done. Thanks again to the people on the list. Cheers Lorenzo 2008/9/29 Paul R : > On Mon, 29 Sep 2008 15:02:57 +0200, "Lorenzo Isella" said: > Lorenzo> ~$ env | grep TERM TERM=xterm COLORTERM=gnome-terminal > > I guess this is the output of the command run from within > gnome-terminal, not from emacs shell mode :) > Run it from shell mode you should read that the term is dumb. > > Lorenzo> [ "$TERM" != "dumb" ]; then eval "`dircolors -b`" alias > Lorenzo> ls='ls --color=auto' #alias > > Here we go. Emacs comint shell is dumb so the alias won't happen. > > > Lorenzo> please, do not laugh, but I am a bit at a loss about the way > Lorenzo> I should put this into my .emacs file. The part dealing with > Lorenzo> the shell is now: > > I don't use M-x shell at all so I have hard time helping you more. > Reading shell.el code yield : > ,---- see lines starting with !!! > | (interactive > | (list > | (and current-prefix-arg > | (read-buffer "Shell buffer: " > | (generate-new-buffer-name "*shell*"))))) > | (setq buffer (get-buffer-create (or buffer "*shell*"))) > | ;; Pop to buffer, so that the buffer's window will be correctly set > | ;; when we call comint (so that comint sets the COLUMNS env var properly). > | (pop-to-buffer buffer) > | (unless (comint-check-proc buffer) > | (let* ((prog (or explicit-shell-file-name > | (getenv "ESHELL") shell-file-name)) > | (name (file-name-nondirectory prog)) > |!!!!! NOTICE BELOW > | (startfile (concat "~/.emacs_" name)) > | (xargs-name (intern-soft (concat "explicit-" name "-args")))) > | (unless (file-exists-p startfile) > | (setq startfile (concat "~/.emacs.d/init_" name ".sh"))) > | (apply 'make-comint-in-buffer "shell" buffer prog > | (if (file-exists-p startfile) startfile) > | (if (and xargs-name (boundp xargs-name)) > | (symbol-value xargs-name) > | '("-i"))) > | (shell-mode))) > | buffer) > `---- > > So what we read here is that shell will try to evaluate (with your > shell) the file ~/.emacs_bash or ~/.emacs.d/init_bash.sh > > So just drop in either file > alias ls='ls --color' > > followed by a blank line (thx comint) and it should work > automagically. > > By the way, have you tried eshell ? In most cases, it just works. > > -- > Paul > -- It is hard to want something you cannot describe.