Fix mouseEventsRequireAlt by stripping alt from PTY mouse reports.

Alt is only used locally to gate passthrough; applications like tmux ignore alt-modified SGR sequences.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Daniel Imms
2026-05-27 16:11:35 -07:00
co-authored by Cursor
parent 7711d780c2
commit f8e9a81d0e
4 changed files with 53 additions and 3 deletions
+7 -1
View File
@@ -163,6 +163,12 @@ export class MouseService implements IMouseService {
return false;
}
// Alt is only used locally to gate mouse passthrough; do not forward it to the
// application (e.g. tmux ignores alt-modified mouse reports).
const stripAltFromReport = but !== CoreMouseButton.WHEEL
&& this._optionsService.rawOptions.mouseEventsRequireAlt
&& this._mouseStateService.areMouseEventsActive;
return this._triggerMouseEvent({
col: pos.col,
row: pos.row,
@@ -171,7 +177,7 @@ export class MouseService implements IMouseService {
button: but,
action,
ctrl: ev.ctrlKey,
alt: ev.altKey,
alt: stripAltFromReport ? false : ev.altKey,
shift: ev.shiftKey
});
}