Skip to content

Commit 86a4dad

Browse files
committed
Improve name of pty host connection request
1 parent 5923027 commit 86a4dad

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/vs/platform/terminal/electron-main/electronPtyHostStarter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarte
2323

2424
private utilityProcess: UtilityProcess | undefined = undefined;
2525

26-
private readonly _onBeforeWindowConnection = new Emitter<void>();
27-
readonly onBeforeWindowConnection = this._onBeforeWindowConnection.event;
26+
private readonly _onRequestConnection = new Emitter<void>();
27+
readonly onRequestConnection = this._onRequestConnection.event;
2828
private readonly _onWillShutdown = new Emitter<void>();
2929
readonly onWillShutdown = this._onWillShutdown.event;
3030

@@ -104,7 +104,7 @@ export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarte
104104
}
105105

106106
private _onWindowConnection(e: IpcMainEvent, nonce: string) {
107-
this._onBeforeWindowConnection.fire();
107+
this._onRequestConnection.fire();
108108

109109
const port = this.utilityProcess!.connect();
110110

src/vs/platform/terminal/node/ptyHost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface IPtyHostConnection {
1414
}
1515

1616
export interface IPtyHostStarter extends IDisposable {
17-
onBeforeWindowConnection?: Event<void>;
17+
onRequestConnection?: Event<void>;
1818
onWillShutdown?: Event<void>;
1919

2020
/**

src/vs/platform/terminal/node/ptyHostService.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ export class PtyHostService extends Disposable implements IPtyService {
102102
this._resolveVariablesRequestStore = this._register(new RequestStore(undefined, this._logService));
103103
this._resolveVariablesRequestStore.onCreateRequest(this._onPtyHostRequestResolveVariables.fire, this._onPtyHostRequestResolveVariables);
104104

105-
// Force the pty host to start as the first window is starting if the starter has that
106-
// capability
107-
if (this._ptyHostStarter.onBeforeWindowConnection) {
108-
Event.once(this._ptyHostStarter.onBeforeWindowConnection)(() => this._ensurePtyHost());
105+
// Start the pty host when a window requests a connection, if the starter has that capability.
106+
if (this._ptyHostStarter.onRequestConnection) {
107+
Event.once(this._ptyHostStarter.onRequestConnection)(() => this._ensurePtyHost());
109108
}
110109

111110
this._ptyHostStarter.onWillShutdown?.(() => this._wasQuitRequested = true);

0 commit comments

Comments
 (0)