Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatability with fish vi key bindings #541

Merged
merged 1 commit into from
Oct 8, 2022
Merged

Conversation

shreve
Copy link
Contributor

@shreve shreve commented Sep 24, 2022

PR #420 addressed the existence of pagination in a fish prompt by trying to track when pagination was enabled and disabled. This introduced atuin-specific bindings for common keys: \t, \e, \r, and \n which export a variable and informs the _autiun_search function to not show the TUI.

Fish has a commandline function that will instead tell you whether pagination is enabled so the user doesn't need to keep track of that state. This PR uses this function, commandline -P to replace the prior TUI supression scheme. Removing these extra function calls allows us to remove the additional bindings which were breaking fish vi key bindings.

Replacing the value for bind -M insert \e completely breaks vi mode by blocking the user from exiting insert mode. By removing these extra binds, this PR restores fish vi mode compatability.

PR atuinsh#420 addressed the existence of pagination in a fish prompt by trying
to track when pagination was enabled and disabled. This introduced
atuin-specific bindings for common keys: `\t`, `\e`, `\r`, and `\n`
which exports a variable and informs the `_autiun_search` function to
not show the TUI.

Fish has a commandline function that will instead tell you whether
pagination is enabled so the user doesn't need to keep track of that
state. This PR uses this function, `commandline -P` to replace the prior
TUI supression scheme. Removing these extra function calls allows us to
remove the additional bindings which were breaking fish vi key bindings.

Replacing the value for `bind -M insert \e` completely breaks vi mode by
blocking the user from exiting insert mode. By removing these extra
binds, this PR restores fish vi mode compatability.
@ellie
Copy link
Member

ellie commented Oct 8, 2022

Oh nice! Thanks for cleaning this up, this is a nicer solution 🙌

@ellie ellie merged commit 0f77f8a into atuinsh:main Oct 8, 2022
@shreve shreve deleted the fish branch October 10, 2022 15:19
@ellie ellie mentioned this pull request Nov 6, 2022
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.

2 participants