MCPcopy
hub / github.com/xtermjs/xterm.js / setModePrivate

Method setModePrivate

src/common/InputHandler.ts:1877–1978  ·  view source on GitHub ↗

* CSI ? Pm h * DEC Private Mode Set (DECSET). * Ps = 1 -> Application Cursor Keys (DECCKM). * Ps = 2 -> Designate USASCII for character sets G0-G3 * (DECANM), and set VT100 mode. * Ps = 3 -> 132 Column Mode (DECCOLM). * Ps = 4 -> Smooth (Slow) Scroll (DECS

(params: IParams)

Source from the content-addressed store, hash-verified

1875 * FIXME: implement DECSCNM, 1049 should clear altbuffer
1876 */
1877 public setModePrivate(params: IParams): boolean {
1878 for (let i = 0; i < params.length; i++) {
1879 switch (params.params[i]) {
1880 case 1:
1881 this._coreService.decPrivateModes.applicationCursorKeys = true;
1882 break;
1883 case 2:
1884 this._charsetService.setgCharset(0, DEFAULT_CHARSET);
1885 this._charsetService.setgCharset(1, DEFAULT_CHARSET);
1886 this._charsetService.setgCharset(2, DEFAULT_CHARSET);
1887 this._charsetService.setgCharset(3, DEFAULT_CHARSET);
1888 // set VT100 mode here
1889 break;
1890 case 3:
1891 /**
1892 * DECCOLM - 132 column mode.
1893 * This is only active if 'SetWinLines' (24) is enabled
1894 * through `options.windowsOptions`.
1895 */
1896 if (this._optionsService.rawOptions.windowOptions.setWinLines) {
1897 this._bufferService.resize(132, this._bufferService.rows);
1898 this._onRequestReset.fire();
1899 }
1900 break;
1901 case 6:
1902 this._coreService.decPrivateModes.origin = true;
1903 this._setCursor(0, 0);
1904 break;
1905 case 7:
1906 this._coreService.decPrivateModes.wraparound = true;
1907 break;
1908 case 12:
1909 this._optionsService.options.cursorBlink = true;
1910 break;
1911 case 45:
1912 this._coreService.decPrivateModes.reverseWraparound = true;
1913 break;
1914 case 66:
1915 this._logService.debug('Serial port requested application keypad.');
1916 this._coreService.decPrivateModes.applicationKeypad = true;
1917 this._onRequestSyncScrollBar.fire();
1918 break;
1919 case 9: // X10 Mouse
1920 // no release, no motion, no wheel, no modifiers.
1921 this._coreMouseService.activeProtocol = 'X10';
1922 break;
1923 case 1000: // vt200 mouse
1924 // no motion.
1925 this._coreMouseService.activeProtocol = 'VT200';
1926 break;
1927 case 1002: // button event mouse
1928 this._coreMouseService.activeProtocol = 'DRAG';
1929 break;
1930 case 1003: // any event mouse
1931 // any event - sends motion events,
1932 // even if there is no button held down.
1933 this._coreMouseService.activeProtocol = 'ANY';
1934 break;

Callers 2

constructorMethod · 0.95

Calls 8

_setCursorMethod · 0.95
saveCursorMethod · 0.95
_eraseAttrDataMethod · 0.95
setgCharsetMethod · 0.65
resizeMethod · 0.65
debugMethod · 0.65
activateAltBufferMethod · 0.65
fireMethod · 0.45

Tested by

no test coverage detected