christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.07k stars 319 forks source link

CMD+K Issue with vim-tmux-navigator Plugin #386

Open aharoJ opened 2 months ago

aharoJ commented 2 months ago

CMD+K Issue with vim-tmux-navigator Plugin

Issue

When using the vim-tmux-navigator plugin, the CMD+K keyboard shortcut, which is typically used to clear the terminal screen, stops working. This issue seems to arise after installing the plugin.

Expected Behavior

Normally, pressing CMD+K in the terminal clears the visible screen content, providing a clean slate. This is a built-in shortcut in many terminal emulators, including Alacritty, iTerm2, and Terminal.app on macOS.

Actual Behavior

After installing the vim-tmux-navigator plugin, the CMD+K shortcut does not clear the terminal as expected. Instead, there is no response, and the screen content remains unchanged.

Steps to Reproduce

  1. Open a tmux session using Alacritty or another terminal emulator.
  2. Press CMD+K to clear the screen — it works as expected.
  3. Install the vim-tmux-navigator plugin following the provided installation instructions.
  4. Reload tmux configuration or start a new tmux session.
  5. Press CMD+K again and observe that the screen is not cleared.
christoomey commented 2 months ago

I'm surprised to hear this as the plugin shouldn't impact Cmd+K (only Ctrl+k). Can you confirm that this works in a bare tmux session (without the plugin configured), and likewise in your terminal without tmux active?

Ultimately I'm guessing Alacritty is mapping Cmd+K to something more familiar to the underlying shell, but not sure about the specifics. As a note, I use Ctrl-l to clear the screen (just scrolls the previous lines off the screen, but that's all I care about), and use this configuration to enable Ctrl-l when using this plugin.