Default key binding changes

Unless I’m missing something (which is 120% possible, I’ve barely touched Rust before), the
prefix check here

        // support ctrl-a prefix, like screen or tmux
        if ctrl && input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a')) {
            self.prefix = true;
            return InputAction::Continue;
        }

occurs before any other key handling is done, and consumes the keypress, so it shouldn’t ever match the resurrected one down in handle_search_input() I think?

A quick test locally seems to show it working as expected with this line unconditionally re-added.

It might even be possible to use this behaviour to have a generic passthrough as well, so C-KEY, C-KEY runs the function bound to just C-KEY in the active window/keymap.

So if someone later adds a C-x binding, I could invoke it with C-x,C-x, etc.

If I manage to get anything working I’ll stick up a draft PR, its probably easier than trying to usefully link to snippets here.

1 Like

sounds about right to me, you’re not missing anything! The line should never be hit while the prefix is c-a

Sorry, I mixed up something. I actually talked about feat: add 'ctrl-a a' to jump to beginning of line by tessus · Pull Request #1917 · atuinsh/atuin · GitHub and only wanted to mention that instead of removing this, it should rather be conditional on the prefix.