Dagmar d'Surreal dagmar.wants at nospam.com
Tue Jul 8 15:16:17 PDT 2003

On Tue, 2003-07-08 at 08:59, eniac wrote:
> Ok. thank you all of you about KDE and additional libraries question.
> One more question.
> In console i have set PS1 to "[\u@\h \w]$ " which give a prompt like
> [root at localhost ~]$
> In KDE that variable seem to be initialized again from KDE and in
> Konsole i get a prompt like bash-2.5$
> How can i config KDE to use as default a PS1 like "[\u@\h \w]$ " ?
> Eniac.

Add something like this to ~/.bashrc

if [ "$TERM" = "xterm" -o \
     "$TERM" = "xterm-color" ]; then
  PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME} : ${PWD}\007"'
  export TERM=xterm-color
export PS1='\u@\h:\w\$ '

This will make sure that every time bash is invoked (most notably with
xterms) that it gets the things set that it needs to have set.  The big
chunky if command at the top is a slight-hack[1], and the PROMPT_COMMAND
will make xterms and like begin displaying what dir you're in an who
you're logged in as in their titles.

[1] Hacks: a) TERM should probably get set to something more exact in
         app-default entry for XTerm, like "xterm-xfree86".  However,
         not everything has a terminfo database that contains an entry
         for this.  The vast majority of equipment I've seen at least
         knows about "xterm-color" so it's comparatively safe.
           b) Changing TERM here _should_ be safe even in the cases
         where someone might be logging in from elsewhere using a
         non-color capable xterm because they'll be getting a login
         shell which doesn't read this file.  (Yes, this is why it is
         appropriate to set this differently from /etc/profile)
           c) There are other problems I'm not mentioning which are
         phenomenally rare and quite unsolvable.  Ce

The email address above is just as phony as it looks, and for obvious reasons.
Instant messaging contact nfo: AIM: evilDagmar  Jabber: evilDagmar at jabber.org

Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message

More information about the blfs-support mailing list