Date: Fri, 19 May 2006 11:47:38 +0200 From: Kyrre Nygard <kyrreny@broadpark.no> To: Dan Nelson <dnelson@allantgroup.com> Cc: questions@freebsd.org, Parv <parv@pair.com> Subject: Re: Converting a zsh prompt to bash Message-ID: <7.0.1.0.2.20060519114621.0225f010@broadpark.no> In-Reply-To: <20060518204826.GB61792@dan.emsphone.com> References: <7.0.1.0.2.20060516102254.021e2b50@broadpark.no> <20060516163920.GB9679@holestein.holy.cow> <7.0.1.0.2.20060517112311.021f9220@broadpark.no> <20060517150438.GA96480@dan.emsphone.com> <7.0.1.0.2.20060518105022.022051b8@broadpark.no> <20060518150254.GA61792@dan.emsphone.com> <7.0.1.0.2.20060518192702.022713f0@broadpark.no> <20060518204826.GB61792@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
At 22:48 18.05.2006, Dan Nelson wrote:
>Mine's strictly functional. User, host, path in left prompt; error
>status in right prompt. Within screen, I add the window number to the
>left prompt and the date&time to the right prompt so I know how long
>I've left a window idle.
>
>if [[ $+WINDOW = 1 && $TERM = screen* ]] ; then
> PROMPT="(%n@%m.$WINDOW) %B%/>%(#/#/)%b "
> RPROMPT="%(?.. %B%?%b)%t %D{%m/%d}"
>else
> PROMPT="(%n@%m) %B%/>%(#/#/)%b "
> RPROMPT="%(?..%?)"
>fi
>
>--
> Dan Nelson
> dnelson@allantgroup.com
This is what I'm now going to settle with.
The screen function was really wicked. I've always felt lost
while I'm messing about my screens.
If you have any advice, please make them regarding this setup:
if [[ `whoami` = root ]] then
a1="%{$fg_bold[red]%}"
a2="%{$fg_no_bold[red]%}"
else
a1="%{$fg_bold[cyan]%}"
a2="%{$fg_no_bold[cyan]%}"
fi
PROMPT="$a1(%n@%m)$a2(%D{%d/%m}+%D{%H:%M})"$'\n'
PROMPT+="$a2(%~) %{$reset_color%}"
if [[ $+WINDOW = 1 && $TERM = screen* ]] then
PROMPT="$a1(%n@%m)$a2($WINDOW)(%D{%d/%m}+%D{%H:%M})"$'\n'
PROMPT+="$a2(%~) %{$reset_color%}"
fi
Thanks :)
Kyrre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7.0.1.0.2.20060519114621.0225f010>
