Skip to content

feat: Terminal app selector#19

Open
mite404 wants to merge 2 commits intolcoutodemos:mainfrom
mite404:terminal-app-selector
Open

feat: Terminal app selector#19
mite404 wants to merge 2 commits intolcoutodemos:mainfrom
mite404:terminal-app-selector

Conversation

@mite404
Copy link
Copy Markdown

@mite404 mite404 commented Mar 19, 2026

Replaces the hardcoded macOS Terminal.app launch with a user-configurable terminal picker.

Screenshot 2026-03-18 at 9 46 59 PM

Feature:

  • Open in CLI button now has a caret next to it (same pattern as the model and permission mode pickers in the status bar) that opens a dropdown of detected terminal apps
  • Detected terminals: macOS Terminal, iTerm 2, Ghostty, Warp — detected by checking standard .app paths in /Applications
  • Selecting a terminal from the dropdown sets it as the default (persisted in clui-settings via localStorage, same key as theme/sound prefs)
  • "Browse..." option opens a native file picker to choose any executable
  • The main "Open in CLI" button always uses the stored preference, falling back to the first detected terminal

Files added:

  • src/main/terminal-detector.ts — scans for known terminal .app bundles, logically separate concern (filesystem detection), would bloat index.ts
  • src/main/terminal-launcher.ts — per-terminal launch logic: AppleScript for Terminal/iTerm2, Ghostty's -e flag, open -a for Warp, separate concern (per-terminal launch logic with multiple strategies)
  • src/renderer/components/TerminalPicker.tsx — the dropdown UI component, I extracted TerminalPicker fn into a new component b/c I didn't want to add ~200ish lines to StatusBar.tsx

Files modified:

  • src/shared/types.ts — added DetectedTerminal, TerminalLaunchMethod, and two new IPC constants
  • src/main/index.ts — updated OPEN_IN_TERMINAL handler to accept terminalName, added DETECT_TERMINALS and SELECT_CUSTOM_TERMINAL handlers
  • src/preload/index.ts — exposed the two new IPC methods on window.clui
  • src/renderer/theme.ts — added preferredTerminal: string | null to the Zustand store and clui-settings persistence
  • src/renderer/components/StatusBar.tsx — replaced the inline "Open in CLI" button with <TerminalPicker />

mite404 added 2 commits March 18, 2026 21:45
Replaces the hardcoded macOS Terminal.app launch with a user-configurable terminal picker.

- 'Open In CLI' btn now has dropdown menu supporting autodetection of installed termainls: Ghostty,
  iTerm2, Warp, OSX Terminal or 'browse to application path selections'

- Selecting a termainal from dropdown sets it as default (persists via `clui-settings` via
  `localStorage` (e.g. theme/sound prefs)

- 'Browse....' option opens native OS file picker modal to choose any   executable

- 'Open in CLI' btn always uses stored preference, or fallsback to first selected terminal

**Files added:**
- `src/main/terminal-detector.ts` — scans for known terminal `.app` bundles
- `src/main/terminal-launcher.ts` — per-terminal launch logic: AppleScript for Terminal/iTerm2,
  Ghostty's `-e` flag, `open -a` for Warp
- `src/renderer/components/TerminalPicker.tsx` — the dropdown UI component

**Files modified:**
- `src/shared/types.ts` — added `DetectedTerminal`, `TerminalLaunchMethod`, and two new IPC
  constants
- `src/main/index.ts` — updated `OPEN_IN_TERMINAL` handler to accept `terminalName`, added
  `DETECT_TERMINALS` and `SELECT_CUSTOM_TERMINAL` handlers
- `src/preload/index.ts` — exposed the two new IPC methods on `window.clui`
- `src/renderer/theme.ts` — added `preferredTerminal: string | null` to the Zustand store and
  `clui-settings` persistence
- `src/renderer/components/StatusBar.tsx` — replaced the inline "Open in CLI" button with
  `<TerminalPicker />

- included `docs/terminal-picker-implementation-plan.md` for transparency
changes `TerminalPicker.tsx`
- Add `cursor: 'pointer'` to btn style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant