@@ -110,21 +110,25 @@ export class PowerShellProcess {
110110 hideFromUser : ! this . sessionSettings . integratedConsole . showOnStartup ,
111111 } ) ;
112112
113+ const pwshName = path . basename ( this . exePath ) ;
114+ this . log . write ( `${ pwshName } started.` ) ;
115+
113116 if ( this . sessionSettings . integratedConsole . showOnStartup ) {
114117 // We still need to run this to set the active terminal to the Integrated Console.
115118 this . consoleTerminal . show ( true ) ;
116119 }
117120
118121 // Start the language client
122+ this . log . write ( "Waiting for session file" ) ;
119123 const sessionDetails = await this . waitForSessionFile ( ) ;
120124
121125 // Subscribe a log event for when the terminal closes
126+ this . log . write ( "Registering terminal close callback" ) ;
122127 this . consoleCloseSubscription = vscode . window . onDidCloseTerminal ( ( terminal ) => this . onTerminalClose ( terminal ) ) ;
123128
124129 // Log that the PowerShell terminal process has been started
125- const terminalPid = await this . consoleTerminal . processId ;
126- const pwshName = path . basename ( this . exePath ) ;
127- this . log . write ( `${ pwshName } started, pid: ${ terminalPid } ` ) ;
130+ this . log . write ( "Registering terminal PID log callback" ) ;
131+ this . consoleTerminal . processId . then ( ( pid ) => this . logTerminalPid ( pid , pwshName ) ) ;
128132
129133 return sessionDetails ;
130134 }
@@ -152,6 +156,10 @@ export class PowerShellProcess {
152156 }
153157 }
154158
159+ private logTerminalPid ( pid : number , exeName : string ) {
160+ this . log . write ( `${ exeName } PID: ${ pid } ` ) ;
161+ }
162+
155163 private isLoginShell ( pwshPath : string ) : boolean {
156164 try {
157165 // We can't know what version of PowerShell we have without running it
@@ -172,9 +180,11 @@ export class PowerShellProcess {
172180 utils . deleteSessionFile ( this . sessionFilePath ) ;
173181
174182 if ( error ) {
183+ this . log . write ( "Error occurred retrieving session file" ) ;
175184 return reject ( error ) ;
176185 }
177186
187+ this . log . write ( "Session file found" ) ;
178188 resolve ( sessionDetails ) ;
179189 } ) ;
180190 } ) ;
0 commit comments