Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to call zle -U while drawing the prompt?
- X-seq: zsh-users 22717
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: How to call zle -U while drawing the prompt?
- Date: Fri, 26 May 2017 17:10:54 -0700
- Cc: Duperon Georges <jahvascriptmaniac@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=JVo8ItxIoJR48mVvjPufn6Mf+XPbFIbtDl66JwoA5UY=; b=LwQPEWQ9U1V1AVZwY2RuSfiU/ljSUDJ8FT0wkwgbuF4UbMrhIEDYVQ49DGhuqQNwu1 pYygpfbu/3MrqS3b0pYBK+HIK+CSkq3tbBwIzSUhjh3et5vnpBzkE9AtI3DoG6Np6KA+ okb31ZIET1EB6mdq2IVVXH0/9s7rarRUeglLMAk0NVrPFrQNGSCqma9Yg0G+CbVc/RvF 8kj29SgGiVrluWlvmuFmNMS2F6sjJwHgH6+3228NNGM3zz8nEBR8Cumy4k7sJl+a02Pn Uvoyt+J/BINOFRzyiH+F4sGeYBz55/eCfKlxYVTeKeHDbrtF2yYNEIal/UdQP870469n CevA==
- In-reply-to: <CAKQnwqadKiW_UTJPzERKzE=EEpEggSjq3cG8EHNKyznC5V1WHA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKQnwqadKiW_UTJPzERKzE=EEpEggSjq3cG8EHNKyznC5V1WHA@mail.gmail.com>
On May 26, 4:45pm, Duperon Georges wrote:
}
} * Call zle -U while drawing the prompt?
} * Or otherwise force zsh to either read all input just before I send
} \e[6n to the terminal?
Make your call to zle -U from zle-line-init.
autoload add-zle-hook-widget
unget_user_input() {
[[ -n "$userinput" ]] && zle -U "$userinput"
unset userinput
}
add-zle-hook-widget line-init unget_user_input
If you're using a version of zsh that doesn't have add-zle-hook-widget
you can just do
zle-line-init() {
[[ -n "$userinput" ]] && zle -U "$userinput"
unset userinput
}
zle -N zle-line-init
Obviously to do this userinput must be a global rather than a local.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author