zsh-workers
 help / color / mirror / code / Atom feed
From: Peter <vmail@mycircuit.org>
To: zsh-workers@zsh.org
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	[thread overview]
Message-ID: <4B5C180D.8080904@mycircuit.org> (raw)
In-Reply-To: <100123155239.ZM27228@torch.brasslantern.com>


> 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


  parent reply	other threads:[~2010-01-24 10:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4B582F3C.2010709@mycircuit.org>
     [not found] ` <100121080540.ZM21444@torch.brasslantern.com>
     [not found]   ` <4B58AB3A.7050300@mycircuit.org>
2010-01-23 10:18     ` PATCH: Add `sourcetrace' option Frank Terbeck
2010-01-23 15:46       ` Baptiste Daroussin
2010-01-23 20:16       ` Richard Hartmann
2010-01-23 21:53         ` PATCH: " Frank Terbeck
2010-01-23 22:07           ` Benjamin R. Haskell
2010-01-23 22:23             ` Frank Terbeck
2010-01-23 23:46               ` Bart Schaefer
2010-01-24  0:10                 ` Frank Terbeck
2010-01-24  0:18                   ` Frank Terbeck
2010-01-24 21:12                     ` Peter Stephenson
2010-01-24 22:27                       ` Frank Terbeck
2010-01-23 22:14           ` PATCH: " Frank Terbeck
2010-01-23 23:44             ` Bart Schaefer
2010-01-24  0:05               ` Frank Terbeck
2010-01-24  9:21       ` Peter
     [not found]     ` <m3fx5y2le2.fsf@klanderman.net>
     [not found]       ` <87hbqdu9xs.fsf@ft.bewatermyfriend.org>
     [not found]         ` <4B5A26BA.5080307@mycircuit.org>
     [not found]           ` <87fx5x6918.fsf@ft.bewatermyfriend.org>
     [not found]             ` <4B5ABB0D.9010504@mycircuit.org>
     [not found]               ` <14989d6e1001230228k22e32200s10db146bd8596dc2@mail.gmail.com>
2010-01-23 12:03                 ` what is the effect of a percentage sign (%) as last character on the command line Peter
     [not found]     ` <2d3b879b1001211336m5b78982au96f267ea472af43d@mail.gmail.com>
     [not found]       ` <4B58D35D.1050208@mycircuit.org>
     [not found]         ` <100121182713.ZM21821@torch.brasslantern.com>
     [not found]           ` <4B597061.10701@mycircuit.org>
     [not found]             ` <100123155239.ZM27228@torch.brasslantern.com>
2010-01-24  9:51               ` Peter [this message]
2010-01-24 10:58                 ` Frank Terbeck
2010-01-24 14:50                   ` Peter
2010-01-26  7:52                   ` Peter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5C180D.8080904@mycircuit.org \
    --to=vmail@mycircuit.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).