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
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
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface IPtyHostConnection {
1414}
1515
1616export interface IPtyHostStarter extends IDisposable {
17- onBeforeWindowConnection ?: Event < void > ;
17+ onRequestConnection ?: Event < void > ;
1818 onWillShutdown ?: Event < void > ;
1919
2020 /**
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments