Reuse terminal operations ordering (#64866)

Fixes #64865
This commit is contained in:
Alex Ross 2018-12-13 11:03:52 +01:00 committed by GitHub
parent 3e560c1b1e
commit 4631da5092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -900,15 +900,7 @@ export class TerminalInstance implements ITerminalInstance {
this._xterm.writeln(shell.initialText);
}
// Initialize new process
const oldTitle = this._title;
this._shellLaunchConfig = shell;
this._createProcess();
if (oldTitle !== this._title) {
this.setTitle(this._title, true);
}
this._processManager.onProcessData(data => this._onProcessData(data));
// Clean up waitOnExit state
if (this._isExiting && this._shellLaunchConfig.waitOnExit) {
this._xterm.setOption('disableStdin', false);
@ -916,7 +908,13 @@ export class TerminalInstance implements ITerminalInstance {
}
// Set the new shell launch config
this._shellLaunchConfig = shell;
this._shellLaunchConfig = shell; // Must be done before calling _createProcess()
// Initialize new process
this._createProcess();
if (oldTitle !== this._title) {
this.setTitle(this._title, true);
}
this._processManager.onProcessData(data => this._onProcessData(data));
}
private _sendRendererInput(input: string): void {