提交 4891adba 编写于 作者: D Daniel Imms

Ensure process os is set before xterm link handler is registered

Fixes #62586
上级 692c89b1
......@@ -426,16 +426,23 @@ export class TerminalInstance implements ITerminalInstance {
this._xterm.on('key', (key, ev) => this._onKey(key, ev));
if (this._processManager) {
if (this._processManager.os === platform.OperatingSystem.Windows) {
this._xterm.winptyCompatInit();
}
this._processManager.onProcessData(data => this._onProcessData(data));
this._xterm.on('data', data => this._processManager!.write(data));
// TODO: How does the cwd work on detached processes?
this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, platform.platform, this._processManager);
this.processReady.then(async () => {
this._linkHandler.processCwd = await this._processManager!.getInitialCwd();
});
// Init winpty compat and link handler after process creation as they rely on the
// underlying process OS
this._processManager.onProcessReady(() => {
if (!this._processManager) {
return;
}
if (this._processManager.os === platform.OperatingSystem.Windows) {
this._xterm.winptyCompatInit();
}
this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, platform.platform, this._processManager);
});
}
this._xterm.on('focus', () => this._onFocus.fire(this));
......@@ -579,7 +586,7 @@ export class TerminalInstance implements ITerminalInstance {
if (this._processManager) {
this._widgetManager = new TerminalWidgetManager(this._wrapperElement);
this._linkHandler.setWidgetManager(this._widgetManager);
this._processManager.onProcessReady(() => this._linkHandler.setWidgetManager(this._widgetManager));
}
const computedStyle = window.getComputedStyle(this._container);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册