Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: If then Prompt
- X-seq: zsh-users 11507
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: fREW <frioux@xxxxxxxxx>
- Subject: Re: If then Prompt
- Date: Thu, 24 May 2007 19:11:42 +0200
- Cc: "Zsh users list" <zsh-users@xxxxxxxxxx>
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Cqrw0j55xiwVuKFV5m3ks6lZov1GgMaXXcHfkrJJkaA/+NrQfoh7wbN0TdKmY/gFwyN/Lx6zXQJop1shysyq6WXv4NBJ3Ev0Y98b1JZcomQ3kM9AmiS09XKyenF44bZsav0PgiNQWW3opKvJAGL3rH9P7p3yUAMAucEmB5lW6jg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jpiwPDzciOoNPwfAgcIWUbGt27uxFbGIVoYSg09qqrOC9fxUEtbSPdNuam8kfBSmYMRIIxlXshtGF6qyfIwGhQLTYd2dR5VoFrDsqh3jugLHpq0evpZSAeZQM7qZ55YuSqOC5xphk8XQnXOa+rHD4imop5DiHeuXSCFet3eYNfI=
- In-reply-to: <fb3648c60705240929i16bb6b3br260bb24b1192cde6@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <fb3648c60705240913pedbd3afx957b60b804b33d1a@xxxxxxxxxxxxxx> <237967ef0705240918w6a923e7fk9e7f28164037715e@xxxxxxxxxxxxxx> <fb3648c60705240929i16bb6b3br260bb24b1192cde6@xxxxxxxxxxxxxx>
On 24/05/07, fREW <frioux@xxxxxxxxx> wrote:
On 5/24/07, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 24/05/07, fREW <frioux@xxxxxxxxx> wrote:
> > Hey all,
> >
> > I was thinking that it would be cool to show the number of jobs if
> > there were more than 0 jobs. I know you can do this with things like
> > the return value, is there any way to do it with jobs?
>
> Sure,
> PS1=$'%(1j.%j jobs .)'
>
> --
> Mikael Magnusson
>
Awesome! Thanks! If anyone cares or wants to see it, here is my
current prompt.
[...]
if [[ $TERM == linux ]]; then
else
precmd () { print -Pn "\e]0;%m: %~\a" }
fi
It doesn't show the username, because it usually doesn't matter to me
what user I am logged into (it's just a user or root) so I don't show
that. Also the last part which will put the current directory in the
title of an xterm doesn't work if you are in a screen session.
if [[ $TERM == screen]; then
function precmd() {
print -Pn "\033]0;S $TTY:t{%100<...<%~%<<}\007"
}
elsif etc
personally i use a case $TERM in ... screen) ... *) ... construct
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author