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

Rebinding keys (MacOS) #61

Open
diminou91 opened this issue Aug 27, 2021 · 1 comment
Open

Rebinding keys (MacOS) #61

diminou91 opened this issue Aug 27, 2021 · 1 comment

Comments

@diminou91
Copy link

Hi there, I'm very new to using tmux-plugins and was wondering if you can help me either for

  • understanding why the alt key is not working (new MacOS user here, guessing the fact that alt/command key is the same makes osx listening for the next keystroke ?), or;
  • explain to me how to rebind a key from a plugin

Either way, I'm thanking you in advance for the help :)

PS : I'm using Alacritty, if that makes any difference

@tiborsimon
Copy link

tiborsimon commented Jul 30, 2022

I am using the following binding to switch between windows and panes on macOS with alacritty:

  • option + [ H | J | K | L ] to navigate between panes
  • control + option + [ H | J | K | L ] to navigate between windows

I had to add a custom mapping to alacritty to be able to send the correct meta key sequence when pressing the option key on macOS:

key_bindings:
  # A workaround to be able to map the option key as meta in other programs.
  # For tmux navigation bindings.
  - { key: J,        mods: Alt,       chars: "\x1bj"                       }
  - { key: K,        mods: Alt,       chars: "\x1bk"                       }
  - { key: H,        mods: Alt,       chars: "\x1bh"                       }
  - { key: L,        mods: Alt,       chars: "\x1bl"                       }
 # For tmux-logging bindings.
  - { key: P,        mods: Alt,       chars: "\x1bp"                       }
  - { key: P,        mods: Alt|Shift, chars: "\x1bP"                       }
  - { key: C,        mods: Alt,       chars: "\x1bc"                       }

With this added, tmux can catch the default bindings defined in tmux-logging.

Source: alacritty/alacritty#93 (comment)

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

2 participants