Expose modes api

Part of #3417
This commit is contained in:
Daniel Imms
2021-08-16 14:44:39 -07:00
parent 012468785b
commit 6affe68ca3
6 changed files with 114 additions and 37 deletions
+52
View File
@@ -622,6 +622,11 @@ declare module 'xterm' {
*/
readonly unicode: IUnicodeHandling;
/**
* Gets the terminal modes as set by SM/DECSET.
*/
readonly modes: IModes;
/**
* Natural language strings that can be localized.
*/
@@ -1622,4 +1627,51 @@ declare module 'xterm' {
*/
activeVersion: string;
}
/**
* Terminal modes as set by SM/DECSET.
*/
export interface IModes {
/**
* Application Cursor Keys (DECCKM): `CSI ? 1 h`
*/
readonly applicationCursorKeysMode: boolean;
/**
* Application Keypad Mode (DECNKM): `CSI ? 6 6 h`
*/
readonly applicationKeypadMode: boolean;
/**
* Bracketed Paste Mode: `CSI ? 2 0 0 4 h`
*/
readonly bracketedPasteMode: boolean;
/**
* Insert Mode (IRM): `CSI 4 h`
*/
readonly insertMode: boolean;
/**
* Mouse Tracking, this can be one of the following:
* - none: This is the default value and can be reset with DECRST
* - x10: Send Mouse X & Y on button press `CSI ? 9 h`
* - vt200: Send Mouse X & Y on button press and release `CSI ? 1 0 0 0 h`
* - drag: Use Cell Motion Mouse Tracking `CSI ? 1 0 0 2 h`
* - any: Use All Motion Mouse Tracking `CSI ? 1 0 0 3 h`
*/
readonly mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any';
/**
* Origin Mode (DECOM): `CSI ? 6 h`
*/
readonly originMode: boolean;
/**
* Reverse-wraparound Mode: `CSI ? 4 5 h`
*/
readonly reverseWraparoundMode: boolean;
/**
* Send FocusIn/FocusOut events: `CSI ? 1 0 0 3 h`
*/
readonly sendFocusMode: boolean;
/**
* Auto-Wrap Mode (DECAWM): `CSI ? 7 h`
*/
readonly wraparoundMode: boolean
}
}