vscode: Integrated terminal mouse reporting not working

  • VSCode 1.44.2
  • macOS 10.14.6

Steps to Reproduce:

  1. Open a file in vim by running vim <file> in the integrated terminal
  2. Type :set mouse=a and press enter, to enable mouse reporting
  3. Now, selecting text in the file you opened does not work

This apparently does not affect tmux.

Does this issue occur when all extensions are disabled?: Yes

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 20 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@nojvek that would be awesome! Here’s roughly what’s involved in that:

Create ITerminalInstance.onBinary, implement the event in TerminalInstance and hook up to xterm:

https://github.com/microsoft/vscode/blob/fa7d5e7def0e9c44041ce2b2f4505ebbbae0a5a0/src/vs/workbench/contrib/terminal/browser/terminal.ts#L291-L295

Copy where onData (aka onProcessData) goes with onBinary (onProcessBinary), find references/text search should help here. It will need to cover:

  • TerminalInstance -> TerminalProcessManager -> TerminalProcess
  • TerminalInstance -> TerminalProcessManager -> TerminalProcessExtHostProxy -> MainThreadTerminalService -> ExtHostTerminalService -> TerminalProcess

There is also RemoteTerminalChannel, just fill in the interfaces and leave a TODO there and I can fill that part in.

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.