-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Integrated terminal mouse reporting not working #96058
Comments
tmux mouse events are working fine for me: Version info: Version: 1.45.0-insider |
@Tyriar My bad, I haven't tested this on tmux or emacs. I thought mouse reporting just wasn't supported at all, but that's clearly not the case. Updated the issue description. Were you able to reproduce the issue in vim? |
You're right it doesn't seem to be working for vim only. @jerch maybe a bug with the mouse protocol changes? 🤔 When entering vim:
Some clicks that don't seem to do anything:
tmux which works fine:
|
@Tyriar vim works fine for me in xterm.js demo. Does vscode forward binary event data from |
@jerch that must be it, |
htop mouse click also doesn' t work. Is it the same problem? |
@xgdgsc Well for me (Ubuntu 18 LTS) htop reports with the old mouse encoding, so yes. Imho it is built with ncurses, still its terminfo states SGR mouse for vscode terminal. Not sure when this was added, it might be an issue with an older ncurses version on your and my system. @Tyriar Guess we should fix the DA responses soon, and maybe reach out to @ThomasDickey about a better fitting terminfo entry? |
@jerch oh would removing the termName reports for xtermjs/xterm.js#2894 move it back to the older encoding? |
Well it seems apps and libs like ncurses have a hard time to figure out what terminal xterm.js is, it seems they go for "safe denominator" which switches off SGR mouse reports for us currently (thats what happens in vim above). This is also the reason why I wrote the DA issue after inspecting the vim source. About a valid terminfo entry - that would help ncurses and similar libs alot to get along with xterm.js. The current entry looks abit like a stub: https://invisible-island.net/ncurses/terminfo.src.html#toc-_Visual__Studio. Also it points to some issues we had in the past, some of them are already fixed. |
I recall that there was a Debian bug report where the Debian developer decided to disable SGR-mouse to simplify use on older systems. This report appears to be a result of that. If you'd like your program to be portable, it has to handle either mode. |
@ThomasDickey The terminal supports X11 reports up to the upper bound (beyond that will stop reporting anything) and SGR. We removed "UTF-8" and "rxvt" support after some discussions about app usage and decided to go with SGR only for higher coords. So yes, the terminal supports X11 and SGR mouse encoding. Care to explain the downvote? |
Your comments might have been constructive if they had been part of a regular bug report. In this context, they weren't constructive. |
Actually, I took a quick look with the current Visual Studio Code, and the any-event report in normal (non-1006) did not appear to work. So I added a to-do item to review that version, and add notes as they apply to that terminal description. |
@ThomasDickey Ah sorry, my note about the terminfo wasnt meant to offend your hard work on it (I only can imagine how awful it is to test against all those lousy emulators popping up) - it was meant as an idea to help to keep the entry up to date. The terminal is still subject of many shifts, which makes it hard to pin it down. Same goes for my DA notion, the emulator does some weird things internally we had a discussion about before. All I am saying - we should fixate that to some reliable values. From my perspective this is well ontopic, because the initial report was about vim, which relies on DA reports (while htop relies on ncurses). |
I see. Will update later, if I find something that helps with this report. |
The terminal in Visual Studio Code 1.45.0 does nothing when the xterm mouse-mode is set to the default (the original mode). I see this using vttest, which shows me that mouse-mode is only sending events when the "Mode" is set to "SGR coordinates". While ncurses 6.1 changed the description for xterm-256color to use "SGR coordinates" (1006), older versions of the terminal database (such as that bundled with MacOS) do not have this change, because they have not been updated for a long time. Debian (and Ubuntu) do not, for a different reason: the packagers modify the terminal database distributed with ncurses by pasting in other entries (including replacing the xterm entries with the source from xterm). You can see this in the package scripts for ncurses-base None of those modifications improves the terminal database, but the replacement of xterm-entries further delays by a year or so the availability of the 1006 mouse mode. I modified xterm's source later, to incorporate changes I'd made for ncurses 6.1, which won't help with problems using bionic (Ubuntu 18). |
@Tyriar is the onBinary hookup for mouse support something I can do without a ton of hand holding? Would really love to get mouse support in vscode terminal. It would open up gateway to build truly interactive terminal apps. |
@nojvek that would be awesome! Here's roughly what's involved in that: Create vscode/src/vs/workbench/contrib/terminal/browser/terminal.ts Lines 291 to 295 in fa7d5e7
Copy where
There is also |
@Tyriar For my own sanity, what is the difference between onData and onBinary? I'd assume the onData would be the raw binary data stream. For my own deeper understanding, is there an architecture page that describes how xterm <-> vscode architecture works? If not that is fine too. The topic interests me that's all. |
@nojvek some data is not extra expressible via JS strings because of how they are encoded, some mouse events include that. I think the introduction of onBinary fixed some obscure bugs with certain mouse events not working, but now they use onBinary and actual bytes are passed around. |
Steps to Reproduce:
vim <file>
in the integrated terminal:set mouse=a
and press enter, to enable mouse reportingThis apparently does not affect tmux.
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: