Skip to content

fix: minor issues with fish's vim mode(s)#3362

Open
rightaditya wants to merge 3 commits intoatuinsh:mainfrom
rightaditya:fish-vi-fixes
Open

fix: minor issues with fish's vim mode(s)#3362
rightaditya wants to merge 3 commits intoatuinsh:mainfrom
rightaditya:fish-vi-fixes

Conversation

@rightaditya
Copy link
Copy Markdown

This PR fixes two minor issues when using Atuin with fish's vim mode(s):

  1. Add support for fish_hybrid_key_bindings: in addition to fish_vi_key_bindings, fish also provides fish_hybrid_key_bindings, which is a vi-based mode with some extra keybinds; but the key bind check for atuin search only checks for the former.
  2. The AI keybind inserts a ? on the command line in vim mode even though it can only be called from normal mode, when pressing ? normally does nothing.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

The Atuin AI fish keybind function is only activated when in the
`default` bind mode, and adds the `?` character to the command line if
the various conditions fail. This shouldn't happen when using one of the
vi key bindings.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

Two targeted fixes for fish vim mode compatibility: adds fish_hybrid_key_bindings alongside fish_vi_key_bindings in _atuin_search (clearly correct), and stops the AI ? keybind from inserting a literal ? in vim normal mode by gating insertion on fish_default_key_bindings.

  • atuin.fish: straightforward one-line fix, no issues.
  • init.rs: the guard works correctly for the three standard binding styles, but the positive check for fish_default_key_bindings will silently discard ? for users with custom emacs-style bindings; checking for the absence of vi-based bindings instead would be more robust.

Confidence Score: 5/5

Safe to merge; both fixes are correct for all standard fish key binding modes.

Only finding is a P2 edge case affecting users with custom emacs-style key bindings, which is not a blocker.

crates/atuin-ai/src/commands/init.rs — the else if condition for ? insertion.

Important Files Changed

Filename Overview
crates/atuin/src/shell/atuin.fish Adds fish_hybrid_key_bindings to the vi mode case in _atuin_search so vim-normal/insert keymap modes are reported correctly for that binding style too.
crates/atuin-ai/src/commands/init.rs Fixes spurious ? insertion in vim normal mode by only inserting when fish_default_key_bindings is active; custom non-vi binding users will silently lose ? insertion in non-empty buffers.

Reviews (1): Last reviewed commit: "fix: Detect both vim modes included in f..." | Re-trigger Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@rightaditya
Copy link
Copy Markdown
Author

Friendly ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant