Fish integration: Have the value of $status preserved by the prompt functions

This commit is contained in:
Kovid Goyal 2021-08-24 20:29:12 +05:30
parent 075b4d252a
commit 72e15d8b4f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

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