| 240 | } |
| 241 | |
| 242 | private isLoginShell(pwshPath: string): boolean { |
| 243 | try { |
| 244 | // We can't know what version of PowerShell we have without running it |
| 245 | // So we try to start PowerShell with -Login |
| 246 | // If it exits successfully, we return true |
| 247 | // If it exits unsuccessfully, node throws, we catch, and return false |
| 248 | cp.execFileSync(pwshPath, [ |
| 249 | "-Login", |
| 250 | "-NoProfile", |
| 251 | "-NoLogo", |
| 252 | "-Command", |
| 253 | "exit 0", |
| 254 | ]); |
| 255 | } catch { |
| 256 | return false; |
| 257 | } |
| 258 | return true; |
| 259 | } |
| 260 | |
| 261 | private async readSessionFile( |
| 262 | sessionFilePath: vscode.Uri, |