mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix InputHandler resetting
This commit is contained in:
+7
-2
@@ -306,7 +306,7 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
this._parser.setEscHandler({final: 'M'}, () => this.reverseIndex());
|
||||
this._parser.setEscHandler({final: '='}, () => this.keypadApplicationMode());
|
||||
this._parser.setEscHandler({final: '>'}, () => this.keypadNumericMode());
|
||||
this._parser.setEscHandler({final: 'c'}, () => this.reset());
|
||||
this._parser.setEscHandler({final: 'c'}, () => this.fullReset());
|
||||
this._parser.setEscHandler({final: 'n'}, () => this.setgLevel(2));
|
||||
this._parser.setEscHandler({final: 'o'}, () => this.setgLevel(3));
|
||||
this._parser.setEscHandler({final: '|'}, () => this.setgLevel(3));
|
||||
@@ -2195,9 +2195,14 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
* DEC mnemonic: RIS (https://vt100.net/docs/vt510-rm/RIS.html)
|
||||
* Reset to initial state.
|
||||
*/
|
||||
public fullReset(): void {
|
||||
this._onRequestReset.fire();
|
||||
}
|
||||
|
||||
public reset(): void {
|
||||
this._parser.reset();
|
||||
this._onRequestReset.fire();
|
||||
this._curAttrData = DEFAULT_ATTR_DATA.clone();
|
||||
this._eraseAttrDataInternal = DEFAULT_ATTR_DATA.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+12
-10
@@ -255,14 +255,18 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
||||
|
||||
this._userScrolling = false;
|
||||
|
||||
// Register input handler and refire/handle events
|
||||
this._inputHandler = new InputHandler(this, this._bufferService, this._charsetService, this._coreService, this._dirtyRowService, this._logService, this.optionsService, this._coreMouseService);
|
||||
this._inputHandler.onRequestBell(() => this.bell());
|
||||
this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end));
|
||||
this._inputHandler.onRequestReset(() => this.reset());
|
||||
this._inputHandler.onCursorMove(() => this._onCursorMove.fire());
|
||||
this._inputHandler.onLineFeed(() => this._onLineFeed.fire());
|
||||
this.register(this._inputHandler);
|
||||
if (this._inputHandler) {
|
||||
this._inputHandler.reset();
|
||||
} else {
|
||||
// Register input handler and refire/handle events
|
||||
this._inputHandler = new InputHandler(this, this._bufferService, this._charsetService, this._coreService, this._dirtyRowService, this._logService, this.optionsService, this._coreMouseService);
|
||||
this._inputHandler.onRequestBell(() => this.bell());
|
||||
this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end));
|
||||
this._inputHandler.onRequestReset(() => this.reset());
|
||||
this._inputHandler.onCursorMove(() => this._onCursorMove.fire());
|
||||
this._inputHandler.onLineFeed(() => this._onLineFeed.fire());
|
||||
this.register(this._inputHandler);
|
||||
}
|
||||
|
||||
this.linkifier = this.linkifier || new Linkifier(this._bufferService, this._logService);
|
||||
|
||||
@@ -1464,7 +1468,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
||||
this.options.rows = this.rows;
|
||||
this.options.cols = this.cols;
|
||||
const customKeyEventHandler = this._customKeyEventHandler;
|
||||
const inputHandler = this._inputHandler;
|
||||
const userScrolling = this._userScrolling;
|
||||
|
||||
this._setup();
|
||||
@@ -1475,7 +1478,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
|
||||
|
||||
// reattach
|
||||
this._customKeyEventHandler = customKeyEventHandler;
|
||||
this._inputHandler = inputHandler;
|
||||
this._userScrolling = userScrolling;
|
||||
|
||||
// do a full screen refresh
|
||||
|
||||
Vendored
+1
-1
@@ -121,7 +121,7 @@ export interface IInputHandler {
|
||||
/** ESC D */ index(): void;
|
||||
/** ESC H */ tabSet(): void;
|
||||
/** ESC M */ reverseIndex(): void;
|
||||
/** ESC c */ reset(): void;
|
||||
/** ESC c */ fullReset(): void;
|
||||
/** ESC n
|
||||
ESC o
|
||||
ESC |
|
||||
|
||||
Reference in New Issue
Block a user