MCPcopy Index your code
hub / github.com/codeaashu/claude-code / detectWindowsTerminal

Function detectWindowsTerminal

src/utils/deepLink/terminalLauncher.ts:157–178  ·  view source on GitHub ↗

* Detect the user's preferred terminal on Windows.

()

Source from the content-addressed store, hash-verified

155 * Detect the user's preferred terminal on Windows.
156 */
157async 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.

Callers 1

detectTerminalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected