@@ -115,6 +115,7 @@ interface TerminalViewportProps {
115115 runtimeEnv ?: Record < string , string > ;
116116 terminalFontFamily : string ;
117117 terminalFontSize : number ;
118+ terminalLineHeight : number ;
118119 onSessionExited : ( ) => void ;
119120 focusRequestId : number ;
120121 autoFocus : boolean ;
@@ -129,6 +130,7 @@ function TerminalViewport({
129130 runtimeEnv,
130131 terminalFontFamily,
131132 terminalFontSize,
133+ terminalLineHeight,
132134 onSessionExited,
133135 focusRequestId,
134136 autoFocus,
@@ -154,7 +156,7 @@ function TerminalViewport({
154156 const fitAddon = new FitAddon ( ) ;
155157 const terminal = new Terminal ( {
156158 cursorBlink : true ,
157- lineHeight : 1.2 ,
159+ lineHeight : terminalLineHeight ,
158160 fontSize : terminalFontSize ,
159161 scrollback : 5_000 ,
160162 fontFamily : terminalFontFamily ,
@@ -419,12 +421,14 @@ function TerminalViewport({
419421
420422 const fontFamilyChanged = terminal . options . fontFamily !== terminalFontFamily ;
421423 const fontSizeChanged = terminal . options . fontSize !== terminalFontSize ;
422- if ( ! fontFamilyChanged && ! fontSizeChanged ) {
424+ const lineHeightChanged = terminal . options . lineHeight !== terminalLineHeight ;
425+ if ( ! fontFamilyChanged && ! fontSizeChanged && ! lineHeightChanged ) {
423426 return ;
424427 }
425428
426429 terminal . options . fontFamily = terminalFontFamily ;
427430 terminal . options . fontSize = terminalFontSize ;
431+ terminal . options . lineHeight = terminalLineHeight ;
428432
429433 const wasAtBottom = terminal . buffer . active . viewportY >= terminal . buffer . active . baseY ;
430434 const frame = window . requestAnimationFrame ( ( ) => {
@@ -448,7 +452,7 @@ function TerminalViewport({
448452 return ( ) => {
449453 window . cancelAnimationFrame ( frame ) ;
450454 } ;
451- } , [ terminalFontFamily , terminalFontSize , terminalId , threadId ] ) ;
455+ } , [ terminalFontFamily , terminalFontSize , terminalLineHeight , terminalId , threadId ] ) ;
452456
453457 useEffect ( ( ) => {
454458 const api = readNativeApi ( ) ;
@@ -673,6 +677,7 @@ export default function ThreadTerminalDrawer({
673677 : "Close Terminal" ;
674678 const terminalFontFamily = appSettings . terminalFontFamily ;
675679 const terminalFontSize = appSettings . terminalFontSize ;
680+ const terminalLineHeight = appSettings . terminalLineHeight ;
676681 const onSplitTerminalAction = useCallback ( ( ) => {
677682 if ( hasReachedTerminalLimit ) return ;
678683 onSplitTerminal ( ) ;
@@ -790,23 +795,21 @@ export default function ThreadTerminalDrawer({
790795 < div className = "pointer-events-none absolute right-2 top-2 z-20" >
791796 < div className = "pointer-events-auto inline-flex items-center overflow-hidden rounded-md border border-border/80 bg-background/70" >
792797 < TerminalActionButton
793- className = { `p-1 text-foreground/90 transition-colors ${
794- hasReachedTerminalLimit
795- ? "cursor-not-allowed opacity-45 hover:bg-transparent"
796- : "hover:bg-accent"
797- } `}
798+ className = { `p-1 text-foreground/90 transition-colors ${ hasReachedTerminalLimit
799+ ? "cursor-not-allowed opacity-45 hover:bg-transparent"
800+ : "hover:bg-accent"
801+ } `}
798802 onClick = { onSplitTerminalAction }
799803 label = { splitTerminalActionLabel }
800804 >
801805 < SquareSplitHorizontal className = "size-3.25" />
802806 </ TerminalActionButton >
803807 < div className = "h-4 w-px bg-border/80" />
804808 < TerminalActionButton
805- className = { `p-1 text-foreground/90 transition-colors ${
806- hasReachedTerminalLimit
807- ? "cursor-not-allowed opacity-45 hover:bg-transparent"
808- : "hover:bg-accent"
809- } `}
809+ className = { `p-1 text-foreground/90 transition-colors ${ hasReachedTerminalLimit
810+ ? "cursor-not-allowed opacity-45 hover:bg-transparent"
811+ : "hover:bg-accent"
812+ } `}
810813 onClick = { onNewTerminalAction }
811814 label = { newTerminalActionLabel }
812815 >
@@ -837,9 +840,8 @@ export default function ThreadTerminalDrawer({
837840 { visibleTerminalIds . map ( ( terminalId ) => (
838841 < div
839842 key = { terminalId }
840- className = { `min-h-0 min-w-0 border-l first:border-l-0 ${
841- terminalId === resolvedActiveTerminalId ? "border-border" : "border-border/70"
842- } `}
843+ className = { `min-h-0 min-w-0 border-l first:border-l-0 ${ terminalId === resolvedActiveTerminalId ? "border-border" : "border-border/70"
844+ } `}
843845 onMouseDown = { ( ) => {
844846 if ( terminalId !== resolvedActiveTerminalId ) {
845847 onActiveTerminalChange ( terminalId ) ;
@@ -854,6 +856,7 @@ export default function ThreadTerminalDrawer({
854856 { ...( runtimeEnv ? { runtimeEnv } : { } ) }
855857 terminalFontFamily = { terminalFontFamily }
856858 terminalFontSize = { terminalFontSize }
859+ terminalLineHeight = { terminalLineHeight }
857860 onSessionExited = { ( ) => onCloseTerminal ( terminalId ) }
858861 focusRequestId = { focusRequestId }
859862 autoFocus = { terminalId === resolvedActiveTerminalId }
@@ -874,6 +877,7 @@ export default function ThreadTerminalDrawer({
874877 { ...( runtimeEnv ? { runtimeEnv } : { } ) }
875878 terminalFontFamily = { terminalFontFamily }
876879 terminalFontSize = { terminalFontSize }
880+ terminalLineHeight = { terminalLineHeight }
877881 onSessionExited = { ( ) => onCloseTerminal ( resolvedActiveTerminalId ) }
878882 focusRequestId = { focusRequestId }
879883 autoFocus
@@ -889,22 +893,20 @@ export default function ThreadTerminalDrawer({
889893 < div className = "flex h-[22px] items-stretch justify-end border-b border-border/70" >
890894 < div className = "inline-flex h-full items-stretch" >
891895 < TerminalActionButton
892- className = { `inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${
893- hasReachedTerminalLimit
894- ? "cursor-not-allowed opacity-45 hover:bg-transparent"
895- : "hover:bg-accent/70"
896- } `}
896+ className = { `inline-flex h-full items-center px-1 text-foreground/90 transition-colors ${ hasReachedTerminalLimit
897+ ? "cursor-not-allowed opacity-45 hover:bg-transparent"
898+ : "hover:bg-accent/70"
899+ } `}
897900 onClick = { onSplitTerminalAction }
898901 label = { splitTerminalActionLabel }
899902 >
900903 < SquareSplitHorizontal className = "size-3.25" />
901904 </ TerminalActionButton >
902905 < TerminalActionButton
903- className = { `inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors ${
904- hasReachedTerminalLimit
905- ? "cursor-not-allowed opacity-45 hover:bg-transparent"
906- : "hover:bg-accent/70"
907- } `}
906+ className = { `inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors ${ hasReachedTerminalLimit
907+ ? "cursor-not-allowed opacity-45 hover:bg-transparent"
908+ : "hover:bg-accent/70"
909+ } `}
908910 onClick = { onNewTerminalAction }
909911 label = { newTerminalActionLabel }
910912 >
@@ -933,11 +935,10 @@ export default function ThreadTerminalDrawer({
933935 { showGroupHeaders && (
934936 < button
935937 type = "button"
936- className = { `flex w-full items-center rounded px-1 py-0.5 text-[10px] uppercase tracking-[0.08em] ${
937- isGroupActive
938- ? "bg-accent/70 text-foreground"
939- : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
940- } `}
938+ className = { `flex w-full items-center rounded px-1 py-0.5 text-[10px] uppercase tracking-[0.08em] ${ isGroupActive
939+ ? "bg-accent/70 text-foreground"
940+ : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
941+ } `}
941942 onClick = { ( ) => onActiveTerminalChange ( groupActiveTerminalId ) }
942943 >
943944 { terminalGroup . terminalIds . length > 1
@@ -951,17 +952,15 @@ export default function ThreadTerminalDrawer({
951952 >
952953 { terminalGroup . terminalIds . map ( ( terminalId ) => {
953954 const isActive = terminalId === resolvedActiveTerminalId ;
954- const closeTerminalLabel = `Close ${
955- terminalLabelById . get ( terminalId ) ?? "terminal"
956- } ${ isActive && closeShortcutLabel ? ` (${ closeShortcutLabel } )` : "" } `;
955+ const closeTerminalLabel = `Close ${ terminalLabelById . get ( terminalId ) ?? "terminal"
956+ } ${ isActive && closeShortcutLabel ? ` (${ closeShortcutLabel } )` : "" } `;
957957 return (
958958 < div
959959 key = { terminalId }
960- className = { `group flex items-center gap-1 rounded px-1 py-0.5 text-[11px] ${
961- isActive
962- ? "bg-accent text-foreground"
963- : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
964- } `}
960+ className = { `group flex items-center gap-1 rounded px-1 py-0.5 text-[11px] ${ isActive
961+ ? "bg-accent text-foreground"
962+ : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
963+ } `}
965964 >
966965 { showGroupHeaders && (
967966 < span className = "text-[10px] text-muted-foreground/80" > └</ span >
0 commit comments