* Detect the user's preferred terminal on Windows.
()
| 155 | * Detect the user's preferred terminal on Windows. |
| 156 | */ |
| 157 | async function detectWindowsTerminal(): Promise<TerminalInfo> { |
| 158 | // Check for Windows Terminal first |
| 159 | const wt = await which('wt.exe') |
| 160 | if (wt) { |
| 161 | return { name: 'Windows Terminal', command: wt } |
| 162 | } |
| 163 | |
| 164 | // PowerShell 7+ (separate install) |
| 165 | const pwsh = await which('pwsh.exe') |
| 166 | if (pwsh) { |
| 167 | return { name: 'PowerShell', command: pwsh } |
| 168 | } |
| 169 | |
| 170 | // Windows PowerShell 5.1 (built into Windows) |
| 171 | const powershell = await which('powershell.exe') |
| 172 | if (powershell) { |
| 173 | return { name: 'PowerShell', command: powershell } |
| 174 | } |
| 175 | |
| 176 | // cmd.exe is always available |
| 177 | return { name: 'Command Prompt', command: 'cmd.exe' } |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Detect the user's preferred terminal emulator. |