File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarte
23
23
24
24
private utilityProcess : UtilityProcess | undefined = undefined ;
25
25
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 ;
28
28
private readonly _onWillShutdown = new Emitter < void > ( ) ;
29
29
readonly onWillShutdown = this . _onWillShutdown . event ;
30
30
@@ -104,7 +104,7 @@ export class ElectronPtyHostStarter extends Disposable implements IPtyHostStarte
104
104
}
105
105
106
106
private _onWindowConnection ( e : IpcMainEvent , nonce : string ) {
107
- this . _onBeforeWindowConnection . fire ( ) ;
107
+ this . _onRequestConnection . fire ( ) ;
108
108
109
109
const port = this . utilityProcess ! . connect ( ) ;
110
110
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface IPtyHostConnection {
14
14
}
15
15
16
16
export interface IPtyHostStarter extends IDisposable {
17
- onBeforeWindowConnection ?: Event < void > ;
17
+ onRequestConnection ?: Event < void > ;
18
18
onWillShutdown ?: Event < void > ;
19
19
20
20
/**
Original file line number Diff line number Diff line change @@ -102,10 +102,9 @@ export class PtyHostService extends Disposable implements IPtyService {
102
102
this . _resolveVariablesRequestStore = this . _register ( new RequestStore ( undefined , this . _logService ) ) ;
103
103
this . _resolveVariablesRequestStore . onCreateRequest ( this . _onPtyHostRequestResolveVariables . fire , this . _onPtyHostRequestResolveVariables ) ;
104
104
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 ( ) ) ;
109
108
}
110
109
111
110
this . _ptyHostStarter . onWillShutdown ?.( ( ) => this . _wasQuitRequested = true ) ;
You can’t perform that action at this time.
0 commit comments