From c682329bd0994f93507b0e13faabd4e12f2f65d8 Mon Sep 17 00:00:00 2001 From: Thomas O'Donnell Date: Fri, 22 Oct 2021 18:54:36 +0200 Subject: [PATCH] fix: Modules not working in fish RPROMPT (#3146) This should fix some modules not working correctly in the fish `RPROMPT`. I have done this the very naive way by simply duplicating the code that is currently in the `fish_prompt` function to avoid having to change the scope of any of the variables (currently all local). --- src/init/starship.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/init/starship.fish b/src/init/starship.fish index 04a218ff0..a6a16fcc9 100644 --- a/src/init/starship.fish +++ b/src/init/starship.fish @@ -13,6 +13,16 @@ function fish_prompt end function fish_right_prompt + switch "$fish_key_bindings" + case fish_hybrid_key_bindings fish_vi_key_bindings + set STARSHIP_KEYMAP "$fish_bind_mode" + case '*' + set STARSHIP_KEYMAP insert + end + set STARSHIP_CMD_STATUS $status + # Account for changes in variable name between v2.7 and v3.0 + set STARSHIP_DURATION "$CMD_DURATION$cmd_duration" + set STARSHIP_JOBS (count (jobs -p)) ::STARSHIP:: prompt --right --terminal-width="$COLUMNS" --status=$STARSHIP_CMD_STATUS --pipestatus=$pipestatus --keymap=$STARSHIP_KEYMAP --cmd-duration=$STARSHIP_DURATION --jobs=$STARSHIP_JOBS end