tenseleyflow/parrot / 77cfd69

Browse files

fix fish hook using history with timestamps instead of argv

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
77cfd69efe39528cec894f8d3ca4e09add08cc73
Parents
6849708
Tree
fa08be7

1 changed file

StatusFile+-
M parrot-hook.fish 2 1
parrot-hook.fishmodified
@@ -14,9 +14,10 @@ function parrot_check
14
 end
14
 end
15
 
15
 
16
 # Function called after each command completes
16
 # Function called after each command completes
17
+# Note: fish_postexec receives the command as $argv[1]
17
 function parrot_postexec --on-event fish_postexec
18
 function parrot_postexec --on-event fish_postexec
18
     set -l exit_code $status
19
     set -l exit_code $status
19
-    set -l last_cmd (history max 1)
20
+    set -l last_cmd $argv[1]
20
 
21
 
21
     # Only mock if command failed and we have a command
22
     # Only mock if command failed and we have a command
22
     if test $exit_code -ne 0; and test -n "$last_cmd"; and parrot_check
23
     if test $exit_code -ne 0; and test -n "$last_cmd"; and parrot_check