@devries-cameron20 / t3code-1 / commits / daf8ee0b2f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): inherit terminal size in simple typography (#5628)

Chris Deeming committed Aug 8, 2026 at 04:31 UTC daf8ee0b2f684cda82e8721abe1138b219b1ef12
4 files changed +38 -3
apps/web/src/appearanceFonts.test.ts
+11
@@ -11,6 +11,7 @@ import {
11 cssFontFamilies,
12 resolveDefaultFamilyLabel,
13 resolveTerminalFontPreference,
14 + resolveTerminalFontSizePreference,
15 } from "./appearanceFonts";
16
17 describe("areFontAdvancesMonospace", () => {
@@ -97,6 +98,16 @@ describe("resolveTerminalFontPreference", () => {
98 });
99 });
100
101 +describe("resolveTerminalFontSizePreference", () => {
102 + it("inherits the code font size in simple mode", () => {
103 + expect(resolveTerminalFontSizePreference({ advanced: false, code: 15, terminal: 12 })).toBe(15);
104 + });
105 +
106 + it("keeps code and terminal font sizes independent in advanced mode", () => {
107 + expect(resolveTerminalFontSizePreference({ advanced: true, code: 15, terminal: 12 })).toBe(12);
108 + });
109 +});
110 +
111 describe("font size clamping", () => {
112 it("keeps sizes inside the ranges the UI can absorb", () => {
113 expect(clampInterfaceFontSize(16)).toBe(16);
apps/web/src/appearanceFonts.ts
+9
@@ -41,6 +41,15 @@ export function resolveTerminalFontPreference(input: {
41 return input.code;
42 }
43
44 +export function resolveTerminalFontSizePreference(input: {
45 + readonly advanced: boolean;
46 + readonly code: number;
47 + readonly terminal: number;
48 +}): number {
49 + if (input.advanced) return input.terminal;
50 + return input.code;
51 +}
52 +
53 function quoteFontFamilyName(name: string): string {
54 const bare = name.trim();
55 if (bare.length === 0) return "";
apps/web/src/components/ThreadTerminalDrawer.tsx
+12 -2
@@ -66,7 +66,11 @@ import { terminalEnvironment } from "../state/terminal";
66 import { openTerminalLinkInPreview } from "./preview/openTerminalLinkInPreview";
67 import { useAtomCommand } from "../state/use-atom-command";
68 import { preventTerminalCloseShortcut } from "../lib/terminalCloseShortcut";
69 -import { resolveTerminalFontPreference, TYPOGRAPHY_ADVANCED_STORAGE_KEY } from "../appearanceFonts";
69 +import {
70 + resolveTerminalFontPreference,
71 + resolveTerminalFontSizePreference,
72 + TYPOGRAPHY_ADVANCED_STORAGE_KEY,
73 +} from "../appearanceFonts";
74
75 const MIN_DRAWER_HEIGHT = 180;
76 const MAX_DRAWER_HEIGHT_RATIO = 0.75;
@@ -341,7 +345,13 @@ export function TerminalViewport({
345 terminal: settings.fontFamilyTerminal,
346 }),
347 );
344 - const terminalFontSize = useClientSettings((settings) => settings.fontSizeTerminal);
348 + const terminalFontSize = useClientSettings((settings) =>
349 + resolveTerminalFontSizePreference({
350 + advanced: advancedTypography,
351 + code: settings.fontSizeCode,
352 + terminal: settings.fontSizeTerminal,
353 + }),
354 + );
355 const terminalFontRef = useRef({ family: terminalFontFamily, size: terminalFontSize });
356 const terminalSession = useAttachedTerminalSession({
357 environmentId,
apps/web/src/components/settings/SettingsPanels.tsx
+6 -1
@@ -100,6 +100,7 @@ import {
100 isMonospaceFamily,
101 resolveDefaultFamilyLabel,
102 resolveTerminalFontPreference,
103 + resolveTerminalFontSizePreference,
104 TYPOGRAPHY_ADVANCED_STORAGE_KEY,
105 } from "../../appearanceFonts";
106 import { CodeFontPreview, PromptFontPreview, TerminalFontPreview } from "./SettingsFontPreviews";
@@ -1272,7 +1273,11 @@ function SimpleFontRows() {
1273 code: settings.fontFamilyCode,
1274 terminal: settings.fontFamilyTerminal,
1275 })}
1275 - size={settings.fontSizeTerminal}
1276 + size={resolveTerminalFontSizePreference({
1277 + advanced: false,
1278 + code: settings.fontSizeCode,
1279 + terminal: settings.fontSizeTerminal,
1280 + })}
1281 />
1282 </>
1283 }