From: Bart Schaefer <schaefer@zanshin.com>
To: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>
Cc: Zsh users list <zsh-users@sunsite.dk>
Subject: Re: [tip] mouse support
Date: Thu, 11 Nov 2004 17:02:47 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.61.0411111647290.13126@toltec.zanshin.com> (raw)
In-Reply-To: <20041111182225.GA4345@sc>
On Thu, 11 Nov 2004, Stephane Chazelas wrote:
> zero='%([BSUbsu]|{*%})'
>
> It replaces '%%some %{%{some%}%}' with '%ome %}' instead of
> '%%some '
Hmm. To fix that, you need extended globbing:
setopt extendedglob
zero='(#b)([^%]|(#s))%([BSUbsu]|{*%})'
print ${(%%)PS1//$~zero/$match[1]}
On Thu, 11 Nov 2004, Stephane Chazelas wrote:
> Well the (%%) expansion flag has another problem:
>
> var='%Sfoo%s'
> PS1='$var'
>
> In that case, you need to expand first the variables in PS1 or
> you'll miss the %S %s visual sequences.
That's easy enough:
if [[ -o promptsubst ]]
then print ${(%%)${(e)PS1}//$~zero/$match[1]}
else print ${(%%)PS1//$~zero/$match[1]}
fi
next prev parent reply other threads:[~2004-11-12 1:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-11 12:20 Stephane Chazelas
2004-11-11 14:40 ` Peter Stephenson
2004-11-11 16:22 ` Stephane Chazelas
2004-11-11 17:47 ` Bart Schaefer
2004-11-11 18:05 ` Stephane Chazelas
2004-11-11 18:22 ` Stephane Chazelas
2004-11-12 1:02 ` Bart Schaefer [this message]
2004-11-12 9:22 ` Stephane Chazelas
2004-11-11 16:07 ` Andy Spiegl
2004-11-11 17:26 ` Stephane Chazelas
2004-11-12 12:02 ` [tip] mouse and mouse-wheel support! Stephane Chazelas
2004-11-15 12:21 ` Stephane Chazelas
2004-11-15 13:14 ` Stephane Chazelas
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=Pine.LNX.4.61.0411111647290.13126@toltec.zanshin.com \
--to=schaefer@zanshin.com \
--cc=Stephane_Chazelas@yahoo.fr \
--cc=zsh-users@sunsite.dk \
/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).