@@ -110,21 +110,25 @@ export class PowerShellProcess {
110
110
hideFromUser : ! this . sessionSettings . integratedConsole . showOnStartup ,
111
111
} ) ;
112
112
113
+ const pwshName = path . basename ( this . exePath ) ;
114
+ this . log . write ( `${ pwshName } started.` ) ;
115
+
113
116
if ( this . sessionSettings . integratedConsole . showOnStartup ) {
114
117
// We still need to run this to set the active terminal to the Integrated Console.
115
118
this . consoleTerminal . show ( true ) ;
116
119
}
117
120
118
121
// Start the language client
122
+ this . log . write ( "Waiting for session file" ) ;
119
123
const sessionDetails = await this . waitForSessionFile ( ) ;
120
124
121
125
// Subscribe a log event for when the terminal closes
126
+ this . log . write ( "Registering terminal close callback" ) ;
122
127
this . consoleCloseSubscription = vscode . window . onDidCloseTerminal ( ( terminal ) => this . onTerminalClose ( terminal ) ) ;
123
128
124
129
// 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 ) ) ;
128
132
129
133
return sessionDetails ;
130
134
}
@@ -152,6 +156,10 @@ export class PowerShellProcess {
152
156
}
153
157
}
154
158
159
+ private logTerminalPid ( pid : number , exeName : string ) {
160
+ this . log . write ( `${ exeName } PID: ${ pid } ` ) ;
161
+ }
162
+
155
163
private isLoginShell ( pwshPath : string ) : boolean {
156
164
try {
157
165
// We can't know what version of PowerShell we have without running it
@@ -172,9 +180,11 @@ export class PowerShellProcess {
172
180
utils . deleteSessionFile ( this . sessionFilePath ) ;
173
181
174
182
if ( error ) {
183
+ this . log . write ( "Error occurred retrieving session file" ) ;
175
184
return reject ( error ) ;
176
185
}
177
186
187
+ this . log . write ( "Session file found" ) ;
178
188
resolve ( sessionDetails ) ;
179
189
} ) ;
180
190
} ) ;
0 commit comments