feat(ui): add terminal open mode setting (new tab vs split)

Add a setting to choose how "Open in Terminal" behaves:
- New Tab: Creates a new tab named after the branch (default)
- Split: Adds to current tab as a split view

Changes:
- Add openTerminalMode setting to terminal state ('newTab' | 'split')
- Update terminal-view to respect the setting
- Add UI in Terminal Settings to toggle the behavior
- Rename pendingTerminalCwd to pendingTerminal with branch name

The new tab mode names tabs after the branch for easy identification.
The split mode is useful for comparing terminals side by side.
This commit is contained in:
Stefan de Vogelaere
2026-01-17 20:22:54 +01:00
parent 03103fd1bb
commit ce4b9b6a14
4 changed files with 94 additions and 40 deletions

View File

@@ -25,6 +25,7 @@ export function TerminalSection() {
setTerminalScrollbackLines,
setTerminalLineHeight,
setTerminalDefaultFontSize,
setOpenTerminalMode,
} = useAppStore();
const {
@@ -34,6 +35,7 @@ export function TerminalSection() {
scrollbackLines,
lineHeight,
defaultFontSize,
openTerminalMode,
} = terminalState;
return (
@@ -165,6 +167,26 @@ export function TerminalSection() {
/>
</div>
{/* Open in Terminal Mode */}
<div className="space-y-3">
<Label className="text-foreground font-medium">Open in Terminal Mode</Label>
<p className="text-xs text-muted-foreground">
How to open terminals from the "Open in Terminal" action in the worktree menu
</p>
<Select
value={openTerminalMode}
onValueChange={(value: 'newTab' | 'split') => setOpenTerminalMode(value)}
>
<SelectTrigger className="w-full">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="newTab">New Tab (named after branch)</SelectItem>
<SelectItem value="split">Split Current Tab</SelectItem>
</SelectContent>
</Select>
</div>
{/* Screen Reader Mode */}
<div className="flex items-center justify-between">
<div className="space-y-1">