import { Label } from '@/components/ui/label'; import { Switch } from '@/components/ui/switch'; import { Slider } from '@/components/ui/slider'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { SquareTerminal, RefreshCw, Terminal, SquarePlus, SplitSquareHorizontal, } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useAppStore } from '@/store/app-store'; import { toast } from 'sonner'; import { TERMINAL_FONT_OPTIONS } from '@/config/terminal-themes'; import { DEFAULT_FONT_VALUE } from '@/config/ui-font-options'; import { useAvailableTerminals } from '@/components/views/board-view/worktree-panel/hooks/use-available-terminals'; import { getTerminalIcon } from '@/components/icons/terminal-icons'; export function TerminalSection() { const { terminalState, setTerminalDefaultRunScript, setTerminalScreenReaderMode, setTerminalFontFamily, setTerminalScrollbackLines, setTerminalLineHeight, setTerminalDefaultFontSize, defaultTerminalId, setDefaultTerminalId, setOpenTerminalMode, } = useAppStore(); const { defaultRunScript, screenReaderMode, fontFamily, scrollbackLines, lineHeight, defaultFontSize, openTerminalMode, } = terminalState; // Get available external terminals const { terminals, isRefreshing, refresh } = useAvailableTerminals(); return (

Terminal

Customize terminal appearance and behavior. Theme follows your app theme in Appearance settings.

{/* Default External Terminal */}

Terminal to use when selecting "Open in Terminal" from the worktree menu

{terminals.length === 0 && (

No external terminals detected. Click refresh to re-scan.

)}
{/* Default Open Mode */}

How to open the integrated terminal when using "Open in Terminal" from the worktree menu

{/* Font Family */}
{/* Default Font Size */}
{defaultFontSize}px
setTerminalDefaultFontSize(value)} className="flex-1" />
{/* Line Height */}
{lineHeight.toFixed(1)}
{ setTerminalLineHeight(value); }} onValueCommit={() => { toast.info('Line height changed', { description: 'Restart terminal for changes to take effect', }); }} className="flex-1" />
{/* Scrollback Lines */}
{(scrollbackLines / 1000).toFixed(0)}k lines
setTerminalScrollbackLines(value)} onValueCommit={() => { toast.info('Scrollback changed', { description: 'Restart terminal for changes to take effect', }); }} className="flex-1" />
{/* Default Run Script */}

Command to run automatically when opening a new terminal (e.g., "claude", "codex")

setTerminalDefaultRunScript(e.target.value)} placeholder="e.g., claude, codex, npm run dev" className="bg-accent/30 border-border/50" />
{/* Screen Reader Mode */}

Enable accessibility mode for screen readers

{ setTerminalScreenReaderMode(checked); toast.success( checked ? 'Screen reader mode enabled' : 'Screen reader mode disabled', { description: 'Restart terminal for changes to take effect', } ); }} />
); }