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

Re: Foreign Commands Not Appearing in 'history' Array When 'sharehistory' Option is Enabled Until a Command is Entered



On Mon, Oct 28, 2024 at 5:43 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Short answers:
>
> On Mon, Oct 28, 2024 at 8:06 AM Langbart <Langbart@xxxxxxxxxxxxxx> wrote:
>>
>>
>> is it a bug that when the 'sharehistory' option is enabled, commands from other shells ('foreign') aren't included in the 'history' array until the user enters a command?
>
> No.

I believe the OP is saying that after you execute a command in one
terminal and press ENTER in another terminal, within that second
terminal all widgets that operate on history, such as
history-incremental-search-backward, will see the command, but the
`history` array won't contain it. You would need to execute a
non-empty command in the second terminal for `history` to get updated.

This sounds quite strange and unexpected to me. Is this really
intended? Why is an empty command enough to for all history related
widgets to pick up commands executed in another terminal, but for
`history` to update you need to execute a non-empty command?

Roman

P.S.

I haven't actually tried it but this is my understanding based on what
the OP wrote here and on github.




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