Skip to content

Commit

Permalink
Fish integration: Have the value of $status preserved by the prompt f…
Browse files Browse the repository at this point in the history
…unctions
  • Loading branch information
kovidgoyal committed Aug 24, 2021
1 parent 075b4d2 commit 72e15d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shell-integration/kitty.fish
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,21 @@ function _ksi_main
end

function _ksi_start_prompt
set --local cmd_status "$status"
if test "$_ksi_prompt_state" != "postexec" -a "$_ksi_prompt_state" != "first-run"
_ksi_mark "D"
end
set --global _ksi_prompt_state "prompt_start"
_ksi_mark "A"
return "$cmd_status" # preserve the value of $status
end

function _ksi_end_prompt
set --local cmd_status "$status"
_ksi_original_fish_prompt
set --global _ksi_prompt_state "prompt_end"
_ksi_mark "B"
return "$cmd_status" # preserve the value of $status
end

functions -c fish_prompt _ksi_original_fish_prompt
Expand Down

0 comments on commit 72e15d8

Please sign in to comment.