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

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

Re: ~/.emacs_bash setting PS1


From: Peter Dyballa
Subject: Re: ~/.emacs_bash setting PS1
Date: Tue, 5 Feb 2008 10:25:40 +0100


Am 05.02.2008 um 02:41 schrieb Samuel Karl Peterson:

However, placing the above line into the ~/.emacs_bash
file doesn't seem to work.

It can't work because shell-mode does not support ANSI code in the prompt. Even if you enable some ANSI-fication with

        (ansi-color-for-comint-mode-on)

it won't. What you can do is to set in the customisation sections (variables and faces) of your user init file (~/.emacs) your prompts' looks (here for a prompt that will look like "pete 1234 /\ "):

         '(comint-prompt-regexp "^[a-z]+ [0-9]+ /\\\\ " t)
         '(shell-prompt-pattern "^[a-z0-9]+ [0-9]+ /\\\\ ")
        
'(comint-highlight-prompt ((t (:background "FloralWhite" :foreground "DarkViolet" :weight bold :family "-*- courier new-medium-r-*-10646-1")))) '(minibuffer-prompt ((t (:background "yellow" :foreground "dark red" :weight bold))))

If you're using *one* user init file for a handful of hosts you would need to put some ELisp code into the customisation to make GNU Emacs distinguish between the hosts and prompts.


BTW, you can also choose different colours for background, foreground, fringes ... that's what I prefer. This can partly also be done by ~/.Xdefaults-<hostname>.

--
Greetings

  Pete

When people run around and around in circles we say they are crazy. When planets do it we say they are orbiting.






reply via email to

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