microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.78k stars 8.34k forks source link

Ssh MouseEvent doesn't work with touch input #11612

Open juleshummelink opened 3 years ago

juleshummelink commented 3 years ago

Windows Terminal version (or Windows build number)

1.10.2714.0

Other Software

found it out by using HTOP on a debian linux server connected via SSH

Steps to reproduce

  1. Ssh into a linux machine via the ssh [IP] command.
  2. Open HTOP by typing sudo htop
  3. Click with your mouse on a row, it becomes selected. Now touch on another row. Nothing happens.

Expected Behavior

Touch inputs are passed to SSH.

Actual Behavior

Touch doesn't work.

zadjii-msft commented 3 years ago

Huh. It should. We must have put the mouse handling in specifically the pressed event and not the tapped event or something like that.

juleshummelink commented 3 years ago

I found that the bug is not ssh related. Touch works nowhere inside the terminal window. It works only in the tab bar and to scroll...

Steps to reproduce:

awfulcooking commented 6 months ago

Does seem to affect TUIs in general rather than specific to SSH 🙂

e.g. htop in WSL, TUIs from Windows .exe.

(v1.19.11213.0 on W11 23H2)

j4james commented 6 months ago

FYI, the reason this doesn't work is because the touch handler in Windows Terminal is completely separate from the click handler, and the only thing the touch handler supports is panning the scrollback buffer.

As a test, I commented out the code here: https://github.com/microsoft/terminal/blob/3996806503bd573aa59a27d1ee8e98bd1d135b8b/src/cascadia/TerminalControl/TermControl.cpp#L1707-L1713

And that allows the touch events to be passed through to the regular click handler, which is good enough to get left clicks working. But of course the scrollback panning is then not supported, and it also doesn't handle right clicks. A proper fix will require more work than that.

It's also worth noting that touch input does actually work in openconsole/conhost.