Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: what is the effect of a percentage sign (%) as last character on the command line
- X-seq: zsh-workers 27635
- From: Peter <vmail@xxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: what is the effect of a percentage sign (%) as last character on the command line
- Date: Sun, 24 Jan 2010 10:51:09 +0100
- In-reply-to: <100123155239.ZM27228@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <4B582F3C.2010709@xxxxxxxxxxxxx> <100121080540.ZM21444@xxxxxxxxxxxxxxxxxxxxxx> <4B58AB3A.7050300@xxxxxxxxxxxxx> <2d3b879b1001211336m5b78982au96f267ea472af43d@xxxxxxxxxxxxxx> <4B58D35D.1050208@xxxxxxxxxxxxx> <100121182713.ZM21821@xxxxxxxxxxxxxxxxxxxxxx> <4B597061.10701@xxxxxxxxxxxxx> <100123155239.ZM27228@xxxxxxxxxxxxxxxxxxxxxx>
I presume you had that somewhere interesting like inside your precmd
or preexec function? Just having it "in .zshrc" wouldn't affect any
command except possibly the very first one.
Yes, sorry , my snippet was too short:
git_info() {
ref=$(git symbolic-ref -q HEAD 2>/dev/null)
ref=${ref#refs/heads}
echo ${ref:+"${GREEN}[$ref]${WHITE}"}
EXITCODE='%(?..(%?%))'
precmd () {
PS1="%m%F{red}${EXITCODE}%f%# "
RPROMPT="$(git_info)%30<..<%/"
case $TERM in
(xterm*|rxvt|mrxvt)
print -Pn "\e]0;%n@%m: $1\a"
;;
esac
}
And to follow your script hint ( with the erronous precmd version above ) :
$ date%
$(127)
$ script zsh.out
Script started, file is zsh.out
$ date%
zsh: command not found: date%
$ <CTRL-D>
Script done, file is zsh.out
$ cat zsh.out
Script started on Sun 24 Jan 2010 10:42:39 AM CET
$ date%
zsh: command not found: date%
$(127)
Script done on Sun 24 Jan 2010 10:43:06 AM CET
$ date%
$(127)
So apparently , the script program swallows the "dangling" control
character and the shell behaves as expected ...
Peter
Messages sorted by:
Reverse Date,
Date,
Thread,
Author