Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Add $ZLE_STATE in zle widgets
- X-seq: zsh-workers 28146
- From: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: PATCH: Add $ZLE_STATE in zle widgets
- Date: Wed, 11 Aug 2010 17:30:59 +0100
- In-reply-to: <877hjx6v9f.fsf@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
- Organization: Cambridge Silicon Radio
- References: <20100803105823.1232a42b@xxxxxxx> <1280868200-11220-1-git-send-email-ft@xxxxxxxxxxxxxxxxxxx> <87vd7n8p7u.fsf@xxxxxxxxxxxxxxxxxxxxxx> <20100811130250.31da4e84@xxxxxxx> <20100811134420.14c58317@xxxxxxx> <87hbj171ik.fsf@xxxxxxxxxxxxxxxxxxxxxx> <20100811154514.58e9c4a8@xxxxxxx> <877hjx6v9f.fsf@xxxxxxxxxxxxxxxxxxxxxx>
On Wed, 11 Aug 2010 17:09:48 +0200
Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> > setopt promptsubst
> > PS1='$MYCONTEXT %# '
> > zle-line-init() {
> > typeset -g MYCONTEXT=$CONTEXT
> > zle reset-prompt
> > }
> > zle -N zle-line-init
> >
> > Now "vared -p $PS1" shows up "vared", otherwise I get "start" (or,
> > in principle, "cont").
>
> But that would put the information in vared's PS1 and not in the one
> of the shell that called vared, wouldn't it? If I could do that, I'd
> know if vared is active even without using its `-p' option.
>
> I could live with doing this, though:
> vared() { builtin vared -p 'vared %% ' "$@" }
vared doesn't have a prompt by default, so unless you're passing it one (in
which case you can always do somethign like what you're suggesting) I don't
see how there can be a problem. Do you really mean you want a default
prompt for vared? A wrapper for vared would probably be the best way of
doing that.
You're not talking about some use of recursive editing to read information
while the line editor is active, are you? You can't do that with vared,
since zle isn't recursive, but you can do it with recursive-edit. For the
same reason there's no question of having a valid shell prompt outside
vared while vared is running --- vared with its prompt (or lack of one) is
the only instance of zle at that point, and when zle is next started you
get a fresh prompt.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
Messages sorted by:
Reverse Date,
Date,
Thread,
Author