Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add xterm mouseleave to dismiss widget #66576
Add a disposable listener to the 'mouseleave' event on the
The real problem is xterm.js does not appear to be listening to the
I have created this PR, which does address the issue, as visible to users, as described in #66421, I believe the real issue actually lies in xterm.js, and this is a workaround rather than a fix.
terminalLinkHander.ts registers the various link handler callbacks which xterm uses to notify vscode that the mouse is over an actionable link, via the tooltipCallback and leaveCallback of the handlers.
If a user mouses over a link which reaches the edge of the xterm window, such as in the case where the terminal is split, and the divider is at the edge of an xterm actionable link, and the user moves the mouse directly out of the xterm element, without leaving the link first, xterm does not fire the leaveCallback event for the handler. This means VS Code wasn't hiding the tooltip/widget. In my opinion, xterm.js should get a fix so that if the mouse leaves the xterm text area where the link is, the leaveCallback of any active links should fire.
A side effect of this workaround, rather than true fix, is that whilst the widget VS Code was displaying now disappears correctly, the xterm link remains underlined in white. If the mouse cursor re-enters the xterm area off of the link, xterm then fires the leaveCallback, and the underline is removed from the link.