From 55705c0855238e2683bf6b4d43f7c7094ddf5126 Mon Sep 17 00:00:00 2001 From: Kevin Turner <83819+keturn@users.noreply.github.com> Date: Mon, 17 Mar 2025 14:27:22 -0700 Subject: [PATCH] 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. --- television/utils/shell/completion.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/television/utils/shell/completion.zsh b/television/utils/shell/completion.zsh index 885b503..ab0255b 100644 --- a/television/utils/shell/completion.zsh +++ b/television/utils/shell/completion.zsh @@ -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