fix(zsh): use history command to include recent entries (#379)

Problem: The `_tv_shell_history` command does not include the most
recent entries in that shell's history.

It uses the `zsh-history` channel, but that's flawed because only the
current shell knows its most recent history; it has not yet been written
to `$HISTFILE`.

Instead, take input from the shell's history command.
This commit is contained in:
Kevin Turner 2025-03-17 14:27:22 -07:00 committed by GitHub
parent ee89b36b42
commit 55705c0855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,8 +32,7 @@ _tv_shell_history() {
local output
output=$(tv zsh-history --input "$current_prompt" $*)
output=$(history -n -1 0 | tv --input "$current_prompt" $*)
if [[ -n $output ]]; then
zle reset-prompt