From 09845bf5ff64b5f0fabfef174896f2db2991df96 Mon Sep 17 00:00:00 2001 From: Aram Akhavan Date: Tue, 21 Jul 2026 13:02:10 -0700 Subject: [PATCH 1/3] fix issues with tide configure --auto causing blank initial prompts --- functions/fish_prompt.fish | 1 + functions/tide/configure/choices/all/finish.fish | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index 994513d3..f121ff2a 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -9,6 +9,7 @@ source (functions --details _tide_pwd) set -l prompt_var _tide_prompt_$fish_pid set -U $prompt_var # Set var here so if we erase $prompt_var, bg job won't set a uvar +set -e _tide_repaint # Clear any repaint flag triggered by the set -U above set_color normal | read -l color_normal status fish-path | read -l fish_path diff --git a/functions/tide/configure/choices/all/finish.fish b/functions/tide/configure/choices/all/finish.fish index f670b1ed..e0f8ee52 100644 --- a/functions/tide/configure/choices/all/finish.fish +++ b/functions/tide/configure/choices/all/finish.fish @@ -1,21 +1,23 @@ function finish _tide_title Finish - echo + set -q _flag_auto || echo set_color red _tide_option y 'Overwrite your current tide config' set_color normal - echo + set -q _flag_auto || echo _tide_option p 'Exit and print the config you just generated' - echo + set -q _flag_auto || echo _tide_menu (status function) switch $_tide_selected_option case 'Overwrite your current tide config' _tide_finish - command -q clear && clear - set -q _flag_auto || _tide_print_configure_current_options + set -q _flag_auto || begin + command -q clear && clear + _tide_print_configure_current_options + end case 'Exit and print the config you just generated' _tide_exit_configure command -q clear && clear From 6d7e848cbe15b02291f30372bf32b56a2aa4d361 Mon Sep 17 00:00:00 2001 From: Aram Akhavan <1147328+kaysond@users.noreply.github.com> Date: Wed, 29 Jul 2026 16:49:26 -0700 Subject: [PATCH 2/3] fix set_color calls leaving trailing escape codes in tide configure --auto --- functions/_tide_sub_configure.fish | 4 ++-- functions/tide/configure/choices/all/finish.fish | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/functions/_tide_sub_configure.fish b/functions/_tide_sub_configure.fish index 22faf3af..b736b781 100644 --- a/functions/_tide_sub_configure.fish +++ b/functions/_tide_sub_configure.fish @@ -56,14 +56,14 @@ function _tide_title -a text set -g _tide_configure_first_option_after_title end -function _tide_option -a symbol text +function _tide_option -a symbol text color set -ga _tide_symbol_list $symbol set -ga _tide_option_list $text if not set -q _flag_auto set -g _tide_configure_first_prompt_after_option - set_color -o + set_color -o $color set -e _tide_configure_first_option_after_title || echo echo "($symbol) $text" set_color normal diff --git a/functions/tide/configure/choices/all/finish.fish b/functions/tide/configure/choices/all/finish.fish index e0f8ee52..422f79ac 100644 --- a/functions/tide/configure/choices/all/finish.fish +++ b/functions/tide/configure/choices/all/finish.fish @@ -2,9 +2,7 @@ function finish _tide_title Finish set -q _flag_auto || echo - set_color red - _tide_option y 'Overwrite your current tide config' - set_color normal + _tide_option y 'Overwrite your current tide config' red set -q _flag_auto || echo _tide_option p 'Exit and print the config you just generated' From e3f12b49776b7c3abd9e2bd6377a3a0b01f91b0b Mon Sep 17 00:00:00 2001 From: Aram Akhavan <1147328+kaysond@users.noreply.github.com> Date: Tue, 25 Aug 2026 19:57:15 -0700 Subject: [PATCH 3/3] fix: dont use transient prompt after builtins --- functions/fish_prompt.fish | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index f121ff2a..fb3e03c8 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -49,7 +49,10 @@ PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$f set -g _tide_last_pid \$last_pid end - if not set -q _tide_transient + if set -q _tide_transient + set -e _tide_at_prompt + else + set -g _tide_at_prompt math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][3]\")+$column_offset | read -lx dist_btwn_sides echo -n $add_newline'$top_left_frame'(string replace @PWD@ (_tide_pwd) \"\$$prompt_var[1][1]\")'$prompt_and_frame_color' @@ -110,10 +113,12 @@ PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$f end if set -q _tide_transient + set -e _tide_at_prompt echo -n \e\[0J add_prefix= _tide_item_character echo -n '$color_normal ' else + set -g _tide_at_prompt math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][2]\")$column_offset | read -lx dist_btwn_sides string replace @PWD@ (_tide_pwd) $add_newline \$$prompt_var[1][1]'$color_normal ' end @@ -153,10 +158,16 @@ end if test "$tide_prompt_transient_enabled" = true function _tide_enter_transient - # If the commandline will be executed or is empty, and the pager is not open - # Pager open usually means selecting, not running + # Only go transient if fish_prompt drew the current prompt. Anything else + # (a `read` inside a function, e.g. the cdh builtin) draws its own prompt, + # so the flag would go unused and stale, hiding the next real prompt + # + # Also require that the commandline will be executed or is empty, and that + # the pager is not open. Pager open usually means selecting, not running # Can be untrue, but it's better than the alternative - if commandline --is-valid || test -z "$(commandline)" && not commandline --paging-mode + if set -q _tide_at_prompt && begin + commandline --is-valid || test -z "$(commandline)" + end && not commandline --paging-mode set -g _tide_transient set -g _tide_repaint commandline -f repaint