Support not recording empty commands in fish + add tests for this

This commit is contained in:
David Dworken 2022-10-23 15:45:50 -07:00
parent aa3f449885
commit d5893f0cfa
3 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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