mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Adds a toggle to disable column selections on mac
This commit is contained in:
@@ -376,7 +376,11 @@ export class SelectionManager extends EventEmitter implements ISelectionManager
|
||||
* @param event The mouse event.
|
||||
*/
|
||||
public shouldForceSelection(event: MouseEvent): boolean {
|
||||
return Browser.isMac ? event.altKey : event.shiftKey;
|
||||
if (Browser.isMac) {
|
||||
return event.altKey && this._terminal.options.macOptionClickForcesSelection;
|
||||
}
|
||||
|
||||
return event.shiftKey;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,6 +98,7 @@ const DEFAULT_OPTIONS: ITerminalOptions = {
|
||||
screenReaderMode: false,
|
||||
debug: false,
|
||||
macOptionIsMeta: false,
|
||||
macOptionClickForcesSelection: false,
|
||||
cancelEvents: false,
|
||||
disableStdin: false,
|
||||
useFlowControl: false,
|
||||
|
||||
Vendored
+10
-1
@@ -124,6 +124,15 @@ declare module 'xterm' {
|
||||
*/
|
||||
macOptionIsMeta?: boolean;
|
||||
|
||||
/**
|
||||
* Whether holding a modifier key will force normal selection behavior,
|
||||
* regardless of whether the terminal is in mouse events mode. This will
|
||||
* also prevent mouse events from being emitted by the terminal. For example,
|
||||
* this allows you to use xterm.js' regular selection inside tmux with
|
||||
* mouse mode enabled.
|
||||
*/
|
||||
macOptionClickForcesSelection?: boolean;
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) The type of renderer to use, this allows using the
|
||||
* fallback DOM renderer when canvas is too slow for the environment. The
|
||||
@@ -562,7 +571,7 @@ declare module 'xterm' {
|
||||
* Retrieves an option's value from the terminal.
|
||||
* @param key The option key.
|
||||
*/
|
||||
getOption(key: 'colors'): string[];
|
||||
getOption(key: 'columnSelectModifiers' | 'colors'): string[];
|
||||
/**
|
||||
* Retrieves an option's value from the terminal.
|
||||
* @param key The option key.
|
||||
|
||||
Reference in New Issue
Block a user