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

MacOS Cmd + k stopped working with the tmux plugin #273

Open
osenvosem opened this issue Jul 11, 2020 · 8 comments
Open

MacOS Cmd + k stopped working with the tmux plugin #273

osenvosem opened this issue Jul 11, 2020 · 8 comments

Comments

@osenvosem
Copy link

osenvosem commented Jul 11, 2020

This keystroke is intended for clearing terminal buffer on MacOS.

MacOS 10.15.5
tmux 3.1b
neovim 0.4.3
Alacritty 0.4.3

@osenvosem osenvosem changed the title MacOS Cmd + k stopped working with the plugin MacOS Cmd + k stopped working with the tmux plugin Jul 11, 2020
@christoomey
Copy link
Owner

The plugin should not have any effect on keybindings using Cmd unless you're using a non-standard setup. Also, just to confirm, the default configuration of the plugin does interfere with Ctrl-l for clear screen, but we have notes on restoring that functionality. Just wanted to highlight in case this is what you're referring to.

Otherwise, some additional questions to help figure this out:

  1. Are you a new user of the plugin and experiencing this with your first setup, or have you used the plugin before with success?
  2. Did this breakage come with an upgrade of any of the listed OS, tmux, or vim versions?
  3. Does this just "not work", or does it behave in an unexpected way?

@osenvosem
Copy link
Author

My setup is standard with no customizations related to the plugin. I refer specifically to Cmd + k because this is the main way to clear terminal on MacOS when you working with it.

  1. I experienced this issue every time I tried to use the plugin. There were a few times I tried it.
  2. No, I don't think so.
  3. Yes, the keystroke in tmux just stop working when I enable the plugin.

@osenvosem
Copy link
Author

By the way, this may be important, I use the Alacritty 0.4.3 terminal emulator.

@osenvosem
Copy link
Author

Cmd+K still switches splits instead of clearing terminal. Any plans to fix that?

@dycw
Copy link

dycw commented Feb 25, 2021

By the way, this may be important, I use the Alacritty 0.4.3 terminal emulator.

Hi @osenvosem I have noticed many things not working out-of-the-box myself with Alacritty; most noticeably this plugin. Although I'm not a Mac user, I believe issues like alacritty/alacritty#2204 are relevant to me and you. I've not gone to investigate much further that this.

@AxZxP
Copy link

AxZxP commented Jun 29, 2022

Is the -k key combo is defined via Alacritty by binding this to the usual Ctrl-k to clear end of the line ?

@BhawickJain
Copy link

I briefly investigated this issue on my Mac, I think the issue lies with

bind-key -n C-l   if-shell  "$is_vim"  "send-keys C-l"   "select-pane -R"

When you press cmd-k the terminal emulator remaps it to Ctrl+l command to the terminal. But Tmux with the config above captures it and interprets the command as select-pane to the right.

I have rebound my keyboard with Karabiner and use alacritty as my terminal emulator. Ideally alacritty could send a clear screen command another way instead of the rebinding, but I suspect that terminals take Ctrl+l to clear screen by default.

For now I'm content typing clear. Would love to hear other people's thoughts/work-arounds on this!

@BhawickJain
Copy link

BhawickJain commented Feb 20, 2024

So I have found a work around which isn't perfect like Ctrl+l. If you're using alacritty you can add a keyboard binding to send clear\n whenever you press cmd+k. Here is my alacritty.toml config snippet:

[keyboard]
bindings = [
{ key = "k", mods = "Command", chars = "clear -x\n" },
]

The -x flag ensures the history of window is still accessible if you scroll up [ref].

This workaround leaves a blank line at the top which is a little unflattering, but functionally it's good enough for me.

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

5 participants