feat: add external terminal support with cross-platform detection

Add support for opening worktree directories in external terminals
(iTerm2, Warp, Ghostty, System Terminal, etc.) while retaining the
integrated terminal as the default option.

Changes:
- Add terminal detection for macOS, Windows, and Linux
- Add "Open in Terminal" split-button in worktree dropdown
- Add external terminal selection in Settings > Terminal
- Add default open mode setting (new tab vs split)
- Display branch name in terminal panel header
- Support 20+ terminals across platforms

Part of #558, Closes #550
This commit is contained in:
Stefan de Vogelaere
2026-01-17 22:57:11 +01:00
parent 502361fc7c
commit 111eb24856
22 changed files with 1565 additions and 146 deletions

View File

@@ -1808,6 +1808,11 @@ export class HttpApiClient implements ElectronAPI {
getDefaultEditor: () => this.get('/api/worktree/default-editor'),
getAvailableEditors: () => this.get('/api/worktree/available-editors'),
refreshEditors: () => this.post('/api/worktree/refresh-editors', {}),
getAvailableTerminals: () => this.get('/api/worktree/available-terminals'),
getDefaultTerminal: () => this.get('/api/worktree/default-terminal'),
refreshTerminals: () => this.post('/api/worktree/refresh-terminals', {}),
openInExternalTerminal: (worktreePath: string, terminalId?: string) =>
this.post('/api/worktree/open-in-external-terminal', { worktreePath, terminalId }),
initGit: (projectPath: string) => this.post('/api/worktree/init-git', { projectPath }),
startDevServer: (projectPath: string, worktreePath: string) =>
this.post('/api/worktree/start-dev', { projectPath, worktreePath }),