Describe the bug
The tide prompt incorrectly displays the vi-mode default icon (❮ fromtide_character_vi_icon_default) even when the fish shell is in emacs-style key bindings (fish_default_key_bindings) and the fish_bind_mode variable is correctly set to insert. This suggests a logic error within the _tide_item_character.fish script.
Steps to reproduce
-
Configure fish shell to use default key bindings (emacs style).
(e.g., set -U fish_key_bindings fish_default_key_bindings or rely on
default).
-
Install tide v6 and complete basic setup via tide configure
(Style: Rainbow, Color: True Color).
-
Set tide_character_icon to ❯ (e.g., set -U tide_character_icon '❯').
-
Set tide_character_vi_icon_default to ❮ (e.g., set -U tide_character_vi_icon_default '❮').
-
Ensure fish_bind_mode is set to insert. In this case, set -g fish_bind_mode insert was added unconditionally at the end of
config.fish because conditional setting failed. (Confirm echo $fish_bind_mode outputs insert).
-
(Optional: Modified _tide_item_character.fish directly in an
attempt to fix, but the core issue persisted, indicating the logic was
still flawed or ignored).
The relevant part of _tide_item_character.fish was originally
similar to:
test "$fish_key_bindings" = fish_default_key_bindings && echo -ns
$tide_character_icon ||
switch $fish_bind_mode
case insert
echo -ns $tide_character_icon
case default
echo -ns $tide_character_vi_icon_default
... other cases
end
(Note: This part was later modified to an explicit if/else block,
but the issue still occurred).
-
Start a new terminal session.
Expected Behavior:
Since fish_key_bindings is default (emacs) and fish_bind_mode is
insert, the prompt icon should display the value of
tide_character_icon, which is ❯.
Actual Behavior:
The prompt icon displays the value of tide_character_vi_icon_default,
which is ❮. This occurs despite fish_bind_mode being insert and
tide_character_icon being explicitly set to ❯.
Screenshots
Environment
Output of tide bug-report:
fish version: 4.5.0
tide version: 6.2.0
term: xterm-kitty
os: macOS Tahoe 26.3
terminal emulator: Kitty
fish startup: 12.41 millis
fisher plugins: jorgebucaran/fisher patrickf1/fzf.fish gazorby/fish-abbreviation-tips ilancosman/tide@v6
Additional context
Root Cause Analysis (Based on user's and agent's findings):
The _tide_item_character.fish script's logic for determining the
character icon appears to be flawed.
- The original
&&/|| structure for fish_default_key_bindings case
seems to allow the switch $fish_bind_mode block to execute or take
precedence even when it shouldn't.
- Even with
fish_bind_mode explicitly set to insert, the switch
statement (if executed) appears to incorrectly fall through to a case
that uses tide_character_vi_icon_default or tide's internal state
forces tide_character_vi_icon_default regardless.
- This specific behavior suggests that
tide is somehow prioritizing
the vi-mode icon (from tide_character_vi_icon_default) despite
fish_key_bindings indicating emacs mode and fish_bind_mode being
insert.
Proposed Solution (for tide maintainers):
The icon determination logic within _tide_item_character.fish needs a
robust review. The core issue is that tide is displaying the vi-mode
icon even when fish_key_bindings is default and fish_bind_mode is
insert. An explicit and clear if/else structure that correctly
prioritizes tide_character_icon when not in actual vi-mode (or
specifically, when fish_key_bindings is fish_default_key_bindings) is
necessary.
Workaround (currently in use by the user):
To achieve the desired ❯ icon, the user has set
tide_character_vi_icon_default to ❯. This forces tide to display
❯ regardless of its internal icon selection logic.
Describe the bug
The tide prompt incorrectly displays the vi-mode default icon (
❮fromtide_character_vi_icon_default) even when thefishshell is in emacs-style key bindings (fish_default_key_bindings) and thefish_bind_modevariable is correctly set toinsert. This suggests a logic error within the_tide_item_character.fishscript.Steps to reproduce
Configure
fishshell to use default key bindings (emacs style).(e.g.,
set -U fish_key_bindings fish_default_key_bindingsor rely ondefault).
Install
tidev6 and complete basic setup viatide configure(Style: Rainbow, Color: True Color).
Set
tide_character_iconto❯(e.g.,set -U tide_character_icon '❯').Set
tide_character_vi_icon_defaultto❮(e.g.,set -U tide_character_vi_icon_default '❮').Ensure
fish_bind_modeis set toinsert. In this case,set -g fish_bind_mode insertwas added unconditionally at the end ofconfig.fishbecause conditional setting failed. (Confirmecho $fish_bind_modeoutputsinsert).(Optional: Modified
_tide_item_character.fishdirectly in anattempt to fix, but the core issue persisted, indicating the logic was
still flawed or ignored).
The relevant part of
_tide_item_character.fishwas originallysimilar to:
test "$fish_key_bindings" = fish_default_key_bindings && echo -ns
$tide_character_icon ||
switch $fish_bind_mode
case insert
echo -ns $tide_character_icon
case default
echo -ns $tide_character_vi_icon_default
... other cases
end
(Note: This part was later modified to an explicit
if/elseblock,but the issue still occurred).
Start a new terminal session.
Expected Behavior:
Since
fish_key_bindingsis default (emacs) andfish_bind_modeisinsert, the prompt icon should display the value oftide_character_icon, which is❯.Actual Behavior:
The prompt icon displays the value of
tide_character_vi_icon_default,which is
❮. This occurs despitefish_bind_modebeinginsertandtide_character_iconbeing explicitly set to❯.Screenshots
Environment
Output of
tide bug-report:Additional context
Root Cause Analysis (Based on user's and agent's findings):
The
_tide_item_character.fishscript's logic for determining thecharacter icon appears to be flawed.
&&/||structure forfish_default_key_bindingscaseseems to allow the
switch $fish_bind_modeblock to execute or takeprecedence even when it shouldn't.
fish_bind_modeexplicitly set toinsert, theswitchstatement (if executed) appears to incorrectly fall through to a case
that uses
tide_character_vi_icon_defaultortide's internal stateforces
tide_character_vi_icon_defaultregardless.tideis somehow prioritizingthe
vi-modeicon (fromtide_character_vi_icon_default) despitefish_key_bindingsindicating emacs mode andfish_bind_modebeinginsert.Proposed Solution (for
tidemaintainers):The icon determination logic within
_tide_item_character.fishneeds arobust review. The core issue is that
tideis displaying thevi-modeicon even when
fish_key_bindingsis default andfish_bind_modeisinsert. An explicit and clearif/elsestructure that correctlyprioritizes
tide_character_iconwhen not in actual vi-mode (orspecifically, when
fish_key_bindingsisfish_default_key_bindings) isnecessary.
Workaround (currently in use by the user):
To achieve the desired
❯icon, the user has settide_character_vi_icon_defaultto❯. This forcestideto display❯regardless of its internal icon selection logic.