Make alt+click behavior configurable

This commit is contained in:
Tony Mottaz
2020-11-20 19:50:03 -06:00
parent 84fa6be370
commit 04e2bdd6ec
4 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -676,7 +676,7 @@ export class SelectionService extends Disposable implements ISelectionService {
this._bufferService.rows,
false
);
if (coordinates && coordinates[0] !== undefined && coordinates[1] !== undefined) {
if (this._optionsService.getOption('altClickMovesCursor') && coordinates && coordinates[0] !== undefined && coordinates[1] !== undefined) {
const sequence = moveToCellSequence(coordinates[0] - 1, coordinates[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);
this._coreService.triggerDataEvent(sequence, true);
}
+1 -1
View File
@@ -50,7 +50,7 @@ export const DEFAULT_OPTIONS: ITerminalOptions = Object.freeze({
windowOptions: {},
windowsMode: false,
wordSeparator: ' ()[]{}\',"`',
altClickMovesCursor: true,
convertEol: false,
termName: 'xterm',
cancelEvents: false
+1
View File
@@ -220,6 +220,7 @@ export interface IPartialTerminalOptions {
export interface ITerminalOptions {
allowProposedApi: boolean;
allowTransparency: boolean;
altClickMovesCursor: boolean;
bellSound: string;
bellStyle: 'none' | 'sound' /* | 'visual' | 'both' */;
cols: number;
+5
View File
@@ -44,6 +44,11 @@ declare module 'xterm' {
*/
allowTransparency?: boolean;
/**
* If enabled, alt + click will move the prompt cursor to position underneath the mouse.
*/
altClickMovesCursor?: boolean;
/**
* A data uri of the sound to use for the bell when `bellStyle = 'sound'`.
*/