diff --git a/functions/_tide_right_prompt.fish b/functions/_tide_right_prompt.fish index b8cf239..5f6ad81 100644 --- a/functions/_tide_right_prompt.fish +++ b/functions/_tide_right_prompt.fish @@ -35,11 +35,11 @@ function _tide_right_prompt end if test $printAtEndedRightPromptHeight -eq $_tide_left_prompt_height - set -U _tide_right_prompt_display $splitText[-1] + set -U _tide_right_prompt_display_$_tide_fish_pid $splitText[-1] set printAtEndedRightPromptHeight (math $printAtEndedRightPromptHeight-1) else _tide_print_at_end $splitText[-1] - set -U _tide_right_prompt_display + set -U _tide_right_prompt_display_$_tide_fish_pid end _tide_cursor_up $printAtEndedRightPromptHeight diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 2cf0bf1..cf045d9 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -1,16 +1,23 @@ function fish_prompt --description 'Created by tide configure' set -lx _tide_last_pipestatus $pipestatus set -lx _tide_last_status $status + set -lx _tide_fish_pid $fish_pid # User for right prompt set -lx COLUMNS $COLUMNS set -q SSH_TTY && set -lx SSH_TTY $SSH_TTY set -lx _tide_cmd_duration $CMD_DURATION - fish --command 'set -U _tide_left_prompt_display (_tide_prompt)' & + fish --command "set -U _tide_left_prompt_display_$fish_pid (_tide_prompt)" & - string unescape $_tide_left_prompt_display + set -l displayVarName _tide_left_prompt_display_$fish_pid + string unescape $$displayVarName end -function _tide_refresh_prompt --on-variable _tide_left_prompt_display --on-variable _tide_right_prompt_display +function _tide_refresh_prompt --on-variable _tide_left_prompt_display_$fish_pid commandline --function repaint +end + +function _tide_on_fish_exit --on-even fish_exit + set -e _tide_left_prompt_display_$fish_pid + set -e _tide_right_prompt_display_$fish_pid end \ No newline at end of file