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: Peter Dyballa
Subject: Re: Emacs Shell Ansi Colors
Date: Mon, 29 Sep 2008 18:08:55 +0200


Am 29.09.2008 um 15:32 schrieb Andreas Politz:

Leave your .emacs as it is and create a file '~/.emacs_bash', insert
the following lines, save and you should have colors.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033 [00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
eval "`dircolors -b`"
alias ls='ls --color=auto'

This is only bash code – don't you think you need to prepare GNU Emacs to *execute* the ANSI codes GNU ls will be emitting? This is true for my GNU Emacs 22.3. Your example of a shell prompt can cause problems in *shell* buffer – such a prompt is not easy to find, which means that older commands also are not easy to find or recognised. You can customise instead the variable comint-highlight-prompt.

There are also other versions of ls around that for example make colourisation depending on terminal capabilities. Anyway, it's good to know that a file ~/.emacs_<shell interpreter> exists that can be used to setup *shell* buffer, for example switch off what's working in xterm or such. Or switch on.

--
Mit friedvollen Grüßen

  Pete                           <]
             o        __o         |__    o       HPV, the real
    ___o    /I       -\<,         |o \  -\),-%     high speed!
___/\ /\___./ \___...O/ O____.....`-O-'-()--o_________________






reply via email to

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