Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion inside vared



I will try to bump up this question once more, since I am stuck on this

tldr: I would like to be able to use the send-break zle widget inside vared to exit it, but when I do, the history file is cropped to one line.
Initially I had the same problem with ctrl-c, but I found out that a
trap 'return 1' INT
is able to prevent the behaviour in that case

thanks for any further help

Pier Paolo Grassi


Il giorno lun 21 feb 2022 alle ore 22:55 Pier Paolo Grassi <pierpaolog@xxxxxxxxx> ha scritto:
>Which history is getting lost?  The global shell history i.e. $HISTFILE?
no, before invoking vared I do

fc -p -a $file 200 200

to have an history specific for the command

I just found out that replacing my previous trap with
trap 'return 1' INT

the history file is preserved after a ctrl-c.
If I instead do ctrl-g (send-break) the history file gets "cleaned" again
by cleaned I mean not really empty, but a file that contains just the first row of the history, for example
if the history file contained:

: 1645479991:0;./Desktop/
: 1645480234:0;./Mail/
: 1645480247:0;./nltk_data/

and I enter vared, than send ctrl-g, the file contains then only 

: 1645479991:0;./Desktop/

Is it possible to catch send-break? is it implemented through a trappable signal?

thanks

Pier Paolo Grassi


Il giorno lun 21 feb 2022 alle ore 20:27 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> ha scritto:
On Sat, Feb 19, 2022 at 9:28 AM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
>
> yes that worked (apart from a space to be added between [[and $ funcstack), thanks.

Something to do with gmail line wrapping/unwrapping, sorry.

> Is there something I can do to exit from vared with a key combination (ctrl-d only works if the line is empty) without losing the history?

Which history is getting lost?  The global shell history i.e. $HISTFILE?

Have you tried exiting vared with ctrl-g ?  Does that have the same problem?


Messages sorted by: Reverse Date, Date, Thread, Author