Skip to content
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

Regression in mouse events which breaks tmux #4781

Closed
Tyriar opened this issue Sep 10, 2023 · 1 comment · Fixed by #4783
Closed

Regression in mouse events which breaks tmux #4781

Tyriar opened this issue Sep 10, 2023 · 1 comment · Fixed by #4783
Assignees
Labels
area/mouse-support type/bug Something is misbehaving
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Sep 10, 2023

VS Code issue: microsoft/vscode#192518

Repro:

  1. Enable mouse events in tmux set -g mouse on in ~/.tmux.conf
  2. Open tmux
  3. Hold shift (to disable passthrough mouse events) and make a selection 🐛 it shows it being selected but as soon as mouseup happens, the selection disappears

It works if mouseup occurs outside the terminal element.

@Tyriar Tyriar added area/mouse-support type/bug Something is misbehaving labels Sep 10, 2023
@Tyriar Tyriar added this to the 5.4.0 milestone Sep 10, 2023
@Tyriar Tyriar self-assigned this Sep 10, 2023
@Tyriar
Copy link
Member Author

Tyriar commented Sep 10, 2023

Removing the event listener changes from #4583 fixes it

if (!(events & CoreMouseEventType.UP)) {
this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);
el.removeEventListener('mouseup', requestedEvents.mouseup!);
requestedEvents.mouseup = null;
} else if (!requestedEvents.mouseup) {
el.addEventListener('mouseup', eventListeners.mouseup);
requestedEvents.mouseup = eventListeners.mouseup;
}

Tyriar added a commit to Tyriar/xterm.js that referenced this issue Sep 10, 2023
Shift+left click is means to force terminal selection and not passthrough
any mouse events, even if a mouse mode is enabled. The change this is
reverting from xtermjs#4583 caused this feature to break by always installing a
global listener on Terminal.element so the SelectionService never got a
chance to cancel is.

Fixes xtermjs#4781
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mouse-support type/bug Something is misbehaving
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant