mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
add IWindowOptions to xterm.d.ts
This commit is contained in:
Vendored
+127
@@ -362,6 +362,133 @@ declare module 'xterm' {
|
||||
tooMuchOutput: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable various window manipulation and report features (CSI Ps ; Ps ; Ps t).
|
||||
*
|
||||
* Note that most settings have no default implementation, as they heavily
|
||||
* rely on the embedding environment.
|
||||
*
|
||||
* To implement a features, create a custom CSI hook like this:
|
||||
* ```Typescript
|
||||
* term.parser.addCsiHandler({final: 't'}, params => {
|
||||
* const ps = params[0];
|
||||
* switch (ps) {
|
||||
* case XY:
|
||||
* ... // your implementation
|
||||
* return true; // signal Ps=XY was handled
|
||||
* }
|
||||
* return false; // any Ps that was not handled
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* All features are disabled by default for security reasons.
|
||||
* All custom implementations are guarded by the boolean values automatically.
|
||||
*/
|
||||
export interface IWindowOptions {
|
||||
/** Ps=1 De-iconify window. */
|
||||
restoreWin?: boolean;
|
||||
/** Ps=2 Iconify window. */
|
||||
minimizeWin?: boolean;
|
||||
/**
|
||||
* Ps=3 ; x ; y
|
||||
* Move window to [x, y].
|
||||
*/
|
||||
setWinPosition?: boolean;
|
||||
/**
|
||||
* Ps = 4 ; height ; width
|
||||
* Resize the window to given `height` and `width` in pixels.
|
||||
* Omitted parameters should reuse the current height or width.
|
||||
* Zero parameters should use the display's height or width.
|
||||
*/
|
||||
setWinSizePixels?: boolean;
|
||||
/** Ps=5 Raise the window to the front of the stacking order. */
|
||||
raiseWin?: boolean;
|
||||
/** Ps=6 Lower the xterm window to the bottom of the stacking order. */
|
||||
lowerWin?: boolean;
|
||||
/** Ps=7 Refresh the window. */
|
||||
refreshWin?: boolean;
|
||||
/**
|
||||
* Ps = 8 ; height ; width
|
||||
* Resize the text area to given height and width in characters.
|
||||
* Omitted parameters should reuse the current height or width.
|
||||
* Zero parameters use the display's height or width.
|
||||
*/
|
||||
setWinSizeChars?: boolean;
|
||||
/**
|
||||
* Ps=9 ; 0 Restore maximized window.
|
||||
* Ps=9 ; 1 Maximize window (i.e., resize to screen size).
|
||||
* Ps=9 ; 2 Maximize window vertically.
|
||||
* Ps=9 ; 3 Maximize window horizontally.
|
||||
*/
|
||||
maximizeWin?: boolean;
|
||||
/**
|
||||
* Ps=10 ; 0 Undo full-screen mode.
|
||||
* Ps=10 ; 1 Change to full-screen.
|
||||
* Ps=10 ; 2 Toggle full-screen.
|
||||
*/
|
||||
fullscreenWin?: boolean;
|
||||
/** Ps=11 Report xterm window state.
|
||||
* If the xterm window is non-iconified, it returns "CSI 1 t".
|
||||
* If the xterm window is iconified, it returns "CSI 2 t".
|
||||
*/
|
||||
getWinState?: boolean;
|
||||
/**
|
||||
* Ps=13 Report xterm window position. Result is "CSI 3 ; x ; y t".
|
||||
* Ps=13 ; 2 Report xterm text-area position. Result is "CSI 3 ; x ; y t".
|
||||
*/
|
||||
getWinPosition?: boolean;
|
||||
/**
|
||||
* Ps=14 Report xterm text area size in pixels. Result is "CSI 4 ; height ; width t".
|
||||
* Ps=14 ; 2 Report xterm window size in pixels. Result is "CSI 4 ; height ; width t".
|
||||
* Ps=14 has a default implementation.
|
||||
*/
|
||||
getWinSizePixels?: boolean;
|
||||
/** Ps=15 Report size of the screen in pixels. Result is "CSI 5 ; height ; width t". */
|
||||
getScreenSizePixels?: boolean;
|
||||
/**
|
||||
* Ps=16 Report xterm character cell size in pixels. Result is "CSI 6 ; height ; width t".
|
||||
* Implemented by default.
|
||||
*/
|
||||
getCellSizePixels?: boolean;
|
||||
/**
|
||||
* Ps=18 Report the size of the text area in characters. Result is "CSI 8 ; height ; width t".
|
||||
* Implemented by default.
|
||||
*/
|
||||
getWinSizeChars?: boolean;
|
||||
/** Ps=19 Report the size of the screen in characters. Result is "CSI 9 ; height ; width t". */
|
||||
getScreenSizeChars?: boolean;
|
||||
/**
|
||||
* Ps=20 Report xterm window's icon label. Result is "OSC L label ST".
|
||||
* Implemented by default.
|
||||
*/
|
||||
getIconTitle?: boolean;
|
||||
/**
|
||||
* Ps=21 Report xterm window's title. Result is "OSC l label ST".
|
||||
* Implemented by default.
|
||||
*/
|
||||
getWinTitle?: boolean;
|
||||
/**
|
||||
* Ps=22 ; 0 Save xterm icon and window title on stack.
|
||||
* Ps=22 ; 1 Save xterm icon title on stack.
|
||||
* Ps=22 ; 2 Save xterm window title on stack.
|
||||
* All variants have a default implementation.
|
||||
*/
|
||||
pushTitle?: boolean;
|
||||
/**
|
||||
* Ps=23 ; 0 Restore xterm icon and window title from stack.
|
||||
* Ps=23 ; 1 Restore xterm icon title from stack.
|
||||
* Ps=23 ; 2 Restore xterm window title from stack.
|
||||
* All variants have a default implementation.
|
||||
*/
|
||||
popTitle?: boolean;
|
||||
/**
|
||||
* Ps>=24 Resize to Ps lines (DECSLPP).
|
||||
* DECSLPP is not implemented. This settings is also used to
|
||||
* enable / disable DECCOLM (earlier variant of DECSLPP).
|
||||
*/
|
||||
setWinLines?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The class that represents an xterm.js terminal.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user