From: "Lorenzo Isella" <lorenzo.isella@gmail.com>
To: "Paul R" <paul.r.ml@gmail.com>
Cc: help-gnu-emacs@gnu.org, Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 16:32:37 +0200 [thread overview]
Message-ID: <a2b3004b0809290732p639c6eccg69f8570bd6874ae6@mail.gmail.com> (raw)
In-Reply-To: <8763of9ikm.fsf@gmail.com>
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 <paul.r.ml@gmail.com>:
> On Mon, 29 Sep 2008 15:02:57 +0200, "Lorenzo Isella" <lorenzo.isella@gmail.com> 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.
next prev parent reply other threads:[~2008-09-29 14:32 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 [this message]
[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=a2b3004b0809290732p639c6eccg69f8570bd6874ae6@mail.gmail.com \
--to=lorenzo.isella@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=paul.r.ml@gmail.com \
--cc=thierry.volpiatto@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).