mintty / wsltty

Mintty as a terminal for Bash on Ubuntu on Windows / WSL
Other
3.11k stars 104 forks source link

Shift + Arrow key doesn't work with tmux #318

Closed FelisNivalis closed 2 years ago

FelisNivalis commented 2 years ago

I started to use tmux recently and found shift+arrow doesn't work there. Tmux by default maps shift+arrows to switch between splits. Nothing happened when I pressed the keys while in tmux, and after detaching the tmux session, they started to work again.

Then I unbinded all tmux's key bindings. In vim, shift+arrows should act as w/b, but still didn't work.

Then I tested in wsl terminal, everything worked fine.

I was using wsltty 3.6.1.2

mintty commented 2 years ago

Open the Options dialog, go to section Window and change the "Modifier for scrolling" which is by default Shift. Does that change things? The Shift+arrow shortcut for scrollback scrolling is normally overriden when screen applications switch to the alternate screen. Usually, tmux does that, but maybe your version is configured not to switch to alternate screen?

FelisNivalis commented 2 years ago

I unticked "shift" for "modifier for scrolling" and it works now! I didn't know that before.

About alternate screen, I tried turning on/off the alternate screen option, and I believe my version is by default on.

I would be curious to know the reason behind it, but since my problem was solved, I'm going to close the issue. And thanks so much! :)