Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Adding to the history from within a widget
- X-seq: zsh-users 24593
- From: dana <dana@xxxxxxx>
- To: Piers Powlesland <pierspowlesland@xxxxxxxxx>
- Subject: Re: Adding to the history from within a widget
- Date: Thu, 2 Jan 2020 21:37:45 -0600
- Cc: zsh-users@xxxxxxx
- In-reply-to: <CAFXacXmkCy3kQsX2b=D5+dtX+F_CxF6K+nUZsHGOBXdC-n7koA@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>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAFXacXmkCy3kQsX2b=D5+dtX+F_CxF6K+nUZsHGOBXdC-n7koA@mail.gmail.com>
On 2 Jan 2020, at 11:14, Piers Powlesland <pierspowlesland@xxxxxxxxx> wrote:
> I tried to use "print -s xxxxx" to add entries to the history from within a
> widget but it doesn't seem to work, although executing the function not as
> a widget does allow me to add entries to the history.
Maybe i misunderstand, but it seems to work for me:
% zsh -f
% foo() { print -s foo test }; zle -N foo; bindkey '^r' foo
% # Press Ctrl+R
% fc -l
1 foo() { print -s foo test }; zle -N foo; bindkey '^r' foo
2 foo test
%
What exactly are you doing that's not working?
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author