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

Alt-N jump back doesn't work on MacOS #417

Closed
conradludgate opened this issue May 19, 2022 · 14 comments
Closed

Alt-N jump back doesn't work on MacOS #417

conradludgate opened this issue May 19, 2022 · 14 comments

Comments

@conradludgate
Copy link
Collaborator

conradludgate commented May 19, 2022

Macs don't have an alt key, and using Option-N doesn't work either.

@justinmcp
Copy link

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

@jucor
Copy link

jucor commented Mar 6, 2023

@justinmcp iTerm2 doesn't give me that choice :/ Any other idea, please? [Edit: see below, PEBKAC, was looking in the wrong place]
image

@jucor
Copy link

jucor commented Mar 6, 2023

Note: using "Option as Meta key" solves the issue in Terminal, thanks. Just can't find the equivalent in iTerm2 3.4.19.

@jucor
Copy link

jucor commented Mar 6, 2023

OK, I'm a moron, I was looking in the wrong place in iTerm2. Thanks @justinmcp for your advice which was on point!
image

Would still be easier if atuin/crossterm recognized Option, but for now Meta will work :) (hoping this won't interfere with other apps :/ )

@ellie
Copy link
Member

ellie commented Mar 8, 2023

Oh awesome! Thank you for finding this! 🙌 Will see if we can also recognize Option

@jucor
Copy link

jucor commented Mar 8, 2023

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 :)

@mizlan
Copy link

mizlan commented Jun 6, 2023

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

@zygous
Copy link
Contributor

zygous commented Jul 16, 2023

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.

@zygous
Copy link
Contributor

zygous commented Jul 16, 2023

What issues might be caused by using Ctrl-n instead of Alt-n on Macs? I've created a PR that does this: #1106

@bitboxer
Copy link

Ideally this would be configurable.

@zygous
Copy link
Contributor

zygous commented Jul 17, 2023

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.

@ellie
Copy link
Member

ellie commented Jul 17, 2023

It needs to be configurable I'm afraid, as otherwise this will break it for all mac users who have reconfigured their setup

@zygous
Copy link
Contributor

zygous commented Jul 17, 2023

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 🙂

@ellie
Copy link
Member

ellie commented Oct 18, 2023

This is now supported via one of the following:

  1. Enable ctrl_n_shortcuts to use ctrl instead of alt
  2. 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

@ellie ellie closed this as completed Oct 18, 2023
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

No branches or pull requests

7 participants