help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Shell Ansi Colors


From: Lorenzo Isella
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 16:32:37 +0200

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]