Add altClickForMouseEvents option for issue #5952

When enabled during mouse events mode, click/drag/move events require the alt
key while wheel events are unaffected. Selection stays enabled by default
and takes precedence over macOptionClickForcesSelection.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-05-27 20:13:31 +00:00
co-authored by Daniel Imms
parent 95d9224b8c
commit fbb2a9710f
8 changed files with 75 additions and 9 deletions
+10
View File
@@ -38,6 +38,16 @@ declare module '@xterm/headless' {
*/
altClickMovesCursor?: boolean;
/**
* When enabled and the terminal is in mouse events mode, mouse click, drag,
* and move events are only sent to the underlying application when the alt
* key is held. Wheel events are not affected. This allows normal text
* selection by default while still supporting application mouse interaction
* and scrolling when holding alt. When enabled, this takes precedence over
* `macOptionClickForcesSelection`.
*/
altClickForMouseEvents?: boolean;
/**
* When enabled the cursor will be set to the beginning of the next line
* with every new line. This is equivalent to sending '\r\n' for each '\n'.
+10
View File
@@ -45,6 +45,16 @@ declare module '@xterm/xterm' {
*/
altClickMovesCursor?: boolean;
/**
* When enabled and the terminal is in mouse events mode, mouse click, drag,
* and move events are only sent to the underlying application when the alt
* key is held. Wheel events are not affected. This allows normal text
* selection by default while still supporting application mouse interaction
* and scrolling when holding alt. When enabled, this takes precedence over
* `macOptionClickForcesSelection`.
*/
altClickForMouseEvents?: boolean;
/**
* When enabled the cursor will be set to the beginning of the next line
* with every new line. This is equivalent to sending `\r\n` for each `\n`.