Is it possible to add keybinds?

I’ve checked the docs, and don’t think this is possible as-is.

Would it be possible to redefine some keybinds to behave differently?
For example, when I select an entry in the history, I would like to press Ctrl-A and have the selected entry pasted into the shell prompt with the cursor at the beginning of the line, so I can, e.g. add sudo when I forget.

Atuin has two behaviour on a selected item depending on which key you press

  • enter: Execute selected item
  • tab: Select item and edit

to amend an entry I choose the entry, hit tab and amend it as I need using my normal shell editing facilities.

1 Like

In general, we have this open issue for custom keybindings: Custom key bindings · Issue #193 · atuinsh/atuin · GitHub - which are not currently supported

Specifically wrt this request though, it’s unlikely we will have this. Unfortunately moving the cursor within your shell line editor is something that your shell has to control, and Atuin has very little say over.

We could potentially work around this in the future, but doing so in a customizable way is also unlikely, and would be very shell dependent.

1 Like

Is it possible to pin this issue on github?

Additonally a discussion could be created here on discourse and referenced in the first post of the gh issue.

P.S.: I’ve created a topic…

Except for the custom keybindings FR, which is in my opinion a valid request, the rest of the requests is something my shell does for me.

I use Zsh, where there is a plugin sudo which allows for prepending sudo to a currently typed command (put there by pressing TAB in Atuin TUI as suggested above) by pressing ESC twice. Immensely useful, I must say. And if I want to type something else or somewhere else in the command, I hit TAB (in Atuin TUI), then ESC only once (on the command line), which places me in a Vim-like normal mode in the command line input line and I can easily move to the beginning of the line (pressing Shift+I), or anywhere else using normal Vim motion keys. It saves me a lot of time and having to press <left arrow> repeatedly.

Thanks for the explanation!
Atuin is very helpful, thanks for making it.

I’ll have to check, but if I can change Tab behavior to Ctrl-A, then I could just double-tap Ctrl-A when I want to edit the beginning of the command.