From d5893f0cfa112ef9adb5c325e57c7d2682a58bc5 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 23 Oct 2022 15:45:50 -0700 Subject: [PATCH] Support not recording empty commands in fish + add tests for this --- client/client_test.go | 2 ++ client/lib/config.fish | 1 + client/lib/test_config.fish | 1 + 3 files changed, 4 insertions(+) diff --git a/client/client_test.go b/client/client_test.go index 0a44d03..e67e54b 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1605,6 +1605,8 @@ func TestFish(t *testing.T) { sleep 0.5 tmux send -t foo echo SPACE foo ENTER sleep 0.5 + tmux send -t foo ENTER + sleep 0.5 tmux send -t foo SPACE echo SPACE baz ENTER sleep 0.5 tmux send -t foo echo SPACE bar ENTER diff --git a/client/lib/config.fish b/client/lib/config.fish index 70afe74..4cc05cd 100644 --- a/client/lib/config.fish +++ b/client/lib/config.fish @@ -14,6 +14,7 @@ function __hishtory_on_prompt --on-event fish_prompt set --global -e _hishtory_first_prompt else if [ -n "$_hishtory_command" ] hishtory saveHistoryEntry fish $_hishtory_exit_code "$_hishtory_command" $_hishtory_start_time & + set --global -e _hishtory_command # Unset _hishtory_command so we don't double-save entries when fish_prompt is invoked but fish_postexec isn't end end diff --git a/client/lib/test_config.fish b/client/lib/test_config.fish index e2e4611..029f289 100644 --- a/client/lib/test_config.fish +++ b/client/lib/test_config.fish @@ -14,6 +14,7 @@ function __hishtory_on_prompt --on-event fish_prompt set --global -e _hishtory_first_prompt else if [ -n "$_hishtory_command" ] hishtory saveHistoryEntry fish $_hishtory_exit_code "$_hishtory_command" $_hishtory_start_time + set --global -e _hishtory_command # Unset _hishtory_command so we don't double-save entries when fish_prompt is invoked but fish_postexec isn't end end