mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-02 11:39:24 +01:00
Support not recording empty commands in fish + add tests for this
This commit is contained in:
parent
aa3f449885
commit
d5893f0cfa
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user