Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $? being clobbered?
- X-seq: zsh-users 6398
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: $? being clobbered?
- Date: Mon, 14 Jul 2003 19:25:41 +0000
- In-reply-to: <20030714173555.GA4352@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20030714173555.GA4352@xxxxxxxxxxxxxxxxxxxxxxxx>
On Jul 14, 1:35pm, Phil!Gregory wrote:
} Subject: $? being clobbered?
}
} I'm having a problem with zsh, and am not sure if it's a bug or a
} feature. If I have a program executed in my prompt, its return status
} clobbers the value of $?, which isn't really what I want.
There's code in the precmd handler to preserve and restore $? but nothing
similar is done during prompt expansion.
Is there some reason to execute the command every time the prompt is
printed? That is, does the command change from one prompt to the next?
If not, I suggest:
unsetopt promptsubst
PROMPT="%{$(echoti cub 80)%}> " # Note double quotes
Otherwise I suggest using precmd:
unsetopt promptsubst
PROMPT='> '
function precmd {
echoti cub 80
}
I feel compelled to remark that moving 80 columns left seems an odd way of
achieving 'setopt promptcr'.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author