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

@@ -296,3 +296,6 @@ export { EVENT_HISTORY_VERSION, DEFAULT_EVENT_HISTORY_INDEX } from './event-hist
// Worktree and PR types
export type { PRState, WorktreePRInfo } from './worktree.js';
export { PR_STATES, validatePRState } from './worktree.js';
// Terminal types
export type { TerminalInfo } from './terminal.js';

View File

@@ -607,6 +607,10 @@ export interface GlobalSettings {
/** Default editor command for "Open In" action (null = auto-detect: Cursor > VS Code > first available) */
defaultEditorCommand: string | null;
// Terminal Configuration
/** Default external terminal ID for "Open In Terminal" action (null = integrated terminal) */
defaultTerminalId: string | null;
// Prompt Customization
/** Custom prompts for Auto Mode, Agent Runner, Backlog Planning, and Enhancements */
promptCustomization?: PromptCustomization;
@@ -896,6 +900,7 @@ export const DEFAULT_GLOBAL_SETTINGS: GlobalSettings = {
codexThreadId: undefined,
mcpServers: [],
defaultEditorCommand: null,
defaultTerminalId: null,
enableSkills: true,
skillsSources: ['user', 'project'],
enableSubagents: true,

View File

@@ -0,0 +1,15 @@
/**
* Terminal types for the "Open In Terminal" functionality
*/
/**
* Information about an available external terminal
*/
export interface TerminalInfo {
/** Unique identifier for the terminal (e.g., 'iterm2', 'warp') */
id: string;
/** Display name of the terminal (e.g., "iTerm2", "Warp") */
name: string;
/** CLI command or open command to launch the terminal */
command: string;
}