atuin
atuin copied to clipboard
Alt-N jump back doesn't work on MacOS
Macs don't have an alt key, and using Option-N doesn't work either.
This is something to set in your terminal emulator.
- for Terminal; Preferences > Profiles (Your profile) > Keyboard > "Use Option as Meta Key"
- for iTerm2; Preferences > Profiles (Your profile) > Keys > Left or Right Option Key setting > "esc+" (or "meta")
@conradludgate
@justinmcp ~iTerm2 doesn't give me that choice :/ Any other idea, please?~ [Edit: see below, PEBKAC, was looking in the wrong place]
Note: using "Option as Meta key" solves the issue in Terminal, thanks. Just can't find the equivalent in iTerm2 3.4.19.
OK, I'm a moron, I was looking in the wrong place in iTerm2. Thanks @justinmcp for your advice which was on point!
Would still be easier if atuin/crossterm recognized Option, but for now Meta will work :) (hoping this won't interfere with other apps :/ )
Oh awesome! Thank you for finding this! 🙌 Will see if we can also recognize Option
Dang, side-effect: remapping to Meta wrecks havoc with entering special characters in the terminal (e.g. in vim) :/ So recognising Option
would be amazing :)
Dang, side-effect: remapping to Meta wrecks havoc with entering special characters in the terminal (e.g. in vim) :/ So recognising
Option
would be amazing :)
This isn't the responsibility of Atuin but rather the terminal emulator
I was just playing with this, because it would be good to be able to use Alt
-n
. I use Kitty as my terminal emulator, so enabling the mapping was easy: just add macos_option_as_alt yes
to its config file.
This worked beautifully! However, when I then went to type #
in a file I found I couldn't: I'm using a British keyboard, so #
is actually Option
-3
(yes, for some reason, Apple still seems to think Brits type §
and ±
more often than #
!)
This means mapping Option
as Alt
is not a solution for me; much as I'd like the Atuin shortcuts, being able to type #
is far more important.
What issues might be caused by using Ctrl
-n
instead of Alt
-n
on Macs? I've created a PR that does this: https://github.com/ellie/atuin/pull/1106
Ideally this would be configurable.
Ideally this would be configurable.
Yes, but getting it working at all for Mac users solves the immediate problem. Making the keybindings configurable is a fair bit more work.
It needs to be configurable I'm afraid, as otherwise this will break it for all mac users who have reconfigured their setup
Yeah, fair enough. I was caught up with the idea that there wouldn't be any Mac users in that situation, because of the breakage I'd seen, but that's a terrible assumption.
I've updated my PR to honour a config setting -- ctrl_n_shortcuts
-- instead of testing the OS. It was actually a lot less work than I anticipated 🙂
This is now supported via one of the following:
- Enable
ctrl_n_shortcuts
to use ctrl instead of alt - Map option to alt, and accept any issues with the keyboard this may cause
See the docs for more! https://atuin.sh/docs/config#macos-ctrl-n-key-shortcuts