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

Re: how to have a common prompt in bash and guake so I can view date and time as part of prompt ?



> if [ "$color_prompt" = yes ]; then
>     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\$
> '

You forgot to add "\d", in PS1 value, that explains different behavior
of prompt in console and Guake.

May be, this could fix the problem


if [ "$color_prompt" = yes ]; then

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:
\d \t \[\033[01;34m\]\w\[\033[00m\$'
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h: \d \t \w\$'
fi


Now, as Wooledge suggested, replace "\d \t" with "$(date +"%d %b %Y
%H:%M:%S")".


Reply to: