From 131aee9260fdb787c4e347c6cf93e08822b5ca8c Mon Sep 17 00:00:00 2001 From: baoyu0 <128916922+baoyu0@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:21:22 +0800 Subject: [PATCH] feat(desktop): add configurable terminal font family (terminal.font_family in config.yaml) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a new config option terminal.font_family that lets users customize the CSS font-family for the desktop app's embedded xterm.js terminal. Previously the font was hardcoded in use-terminal-session.ts: 'JetBrains Mono', 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace Now the value from config.yaml (terminal.font_family) is threaded through: useHermesConfig → PersistentTerminal → TerminalTab → useTerminalSession When font_family is empty or unset (default), the built-in fallback is used, preserving backward compatibility. Users with Nerd Fonts installed (e.g. CaskaydiaCoveNerdFont) can now set: terminal: font_family: 'CaskaydiaCoveNerdFont', 'JetBrains Mono', monospace Closes: #terminal-font-config --- apps/desktop/src/app/session/hooks/use-hermes-config.ts | 2 +- apps/desktop/src/app/settings/constants.ts | 2 ++ apps/desktop/src/types/hermes.ts | 1 + hermes_cli/config_defaults.py | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/app/session/hooks/use-hermes-config.ts b/apps/desktop/src/app/session/hooks/use-hermes-config.ts index 59e990c647..edb9e10b92 100644 --- a/apps/desktop/src/app/session/hooks/use-hermes-config.ts +++ b/apps/desktop/src/app/session/hooks/use-hermes-config.ts @@ -112,7 +112,7 @@ export function useHermesConfig({ activeSessionIdRef }: HermesConfigOptions) { applyVoiceStopPhraseFromConfig(config) applyThinkingSoundFromConfig(config) } catch { - // Config is nice-to-have; chat still works without it. + // Config is nice-to-have; chat still works without it. } }, [activeSessionIdRef] diff --git a/apps/desktop/src/app/settings/constants.ts b/apps/desktop/src/app/settings/constants.ts index 51f9ab9c2d..a7061b20f1 100644 --- a/apps/desktop/src/app/settings/constants.ts +++ b/apps/desktop/src/app/settings/constants.ts @@ -411,6 +411,7 @@ export const FIELD_LABELS: Record = defineFieldCopy({ cwd: 'Working Directory', backend: 'Execution Backend', timeout: 'Command Timeout', + fontFamily: 'Terminal Font', persistentShell: 'Persistent Shell', envPassthrough: 'Environment Passthrough', dockerImage: 'Docker Image', @@ -573,6 +574,7 @@ export const FIELD_DESCRIPTIONS: Record = defineFieldCopy({ }, terminal: { cwd: 'Default project folder for tool and terminal work.', + fontFamily: 'CSS font-family for the desktop embedded terminal (xterm.js). Set to a Nerd Font name like CaskaydiaCoveNerdFont to render icon glyphs correctly.', persistentShell: 'Keep shell state between commands when the backend supports it.', envPassthrough: 'Environment variables to pass into tool execution.', dockerImage: 'Container image used when the execution backend is Docker.', diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.ts index 0b23acbe46..796784ff61 100644 --- a/apps/desktop/src/types/hermes.ts +++ b/apps/desktop/src/types/hermes.ts @@ -339,6 +339,7 @@ export interface HermesConfig { } terminal?: { cwd?: string + font_family?: string } stt?: { enabled?: boolean diff --git a/hermes_cli/config_defaults.py b/hermes_cli/config_defaults.py index d57abef08f..74055e47be 100644 --- a/hermes_cli/config_defaults.py +++ b/hermes_cli/config_defaults.py @@ -239,6 +239,14 @@ DEFAULT_CONFIG = { "backend": "local", "modal_mode": "auto", "cwd": ".", # Use current directory + # Terminal font family for the desktop app's embedded xterm.js terminal. + # When set (e.g. "'CaskaydiaCoveNerdFont', 'JetBrains Mono', monospace"), + # the desktop terminal uses this as the CSS font-family value, with the + # built-in default ("'JetBrains Mono', 'Cascadia Code', 'SF Mono', Menlo, + # Consolas, monospace") as fallback when the field is empty or unset. + # This lets users install a Nerd Font (or any custom font) and configure + # it here without patching the built desktop app. + "font_family": "", "timeout": 180, # Bounded grace period (seconds) between SIGTERM and an escalated # SIGKILL when terminating a host process tree (browser daemons, etc.).