Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A ZLE widget for calculator
> On 03/02/2026 19:38 GMT Vincent Bernat <bernat@xxxxxxxx> wrote:
> > Does adding "print -s <line>" to the function work?
>
> This is already there. It works. If I hit return, then up, it works. But
> if I press only up, it does not. It seems accept-line widget is needed
> for the line to be added to the history.
Indeed, I wasn't looking very hard. I guess it's the same basic issue
that this use case hasn't been thought through before.
Changing the reorded history compared with what's actually executed
seems a reasonable thing to have, given all the other things you can do
with history.
> > (I was thinking about getting the shell to ignore the line executed as
> > well --- there are features for this --- but it's not quite smooth as
> > the line does hang around until after you execute something else, so
> > doesn't look like that would be what you want. But maybe you now have
> > enough anyway...)
>
> I can prefix with a space if that's what you mean, but in this case
> pressing up just after will recall this instance (which is quoted). So,
> yes, this is not as smooth as I would like.
There are other ways, such as the HISTORY_IGNORE variable and returning
1 from zshaddhistory(), but they all have the same issue.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author