Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(terminal): glass terminal nodes
iceclatterWTe2199d11701e
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsxindex 8dc591ce2..a5ffa3055 100644--- a/src/renderer/nodes/TerminalNode.tsx+++ b/src/renderer/nodes/TerminalNode.tsx@@ -178,6 +178,8 @@ import { useCopyFeedback } from '../terminal/useCopyFeedback'import { ContextMeter } from '../components/ContextMeter'import { isZoomModifierHeld } from '../lib/zoomModifier'import { isHidden } from '../lib/ui-visibility'+import { glassTint } from '../lib/glassContrast'+import { resolveTerminalTheme } from '../terminal/themes'import { readsClaudeTranscript } from '../lib/transcriptGates'import { liveProjectJumpTarget } from '../lib/projectJump'import { pushSessionRename } from '../lib/sessionRename'@@ -1241,6 +1243,17 @@ export function TerminalNode({// Scoped to the OWNING project so its `terminal.theme` / `terminal.fontFamily` layer over the// global settings for this node, and for no other project's nodes.const visual = useXtermVisualSettings(owningProjectId())+ // Glass terminals (Settings → Appearance): xterm paints no background and the node supplies a+ // translucent tint of THIS node's effective theme — project override included — at the alpha+ // that keeps its foreground at 4.5:1 over any backdrop (lib/glassContrast.ts).+ const glass = useSettings((s) => s.settings.glassTerminals) === true+ const glassVars = useMemo(() => {+ if (!glass) return null+ const tint = glassTint(resolveTerminalTheme(visual.terminalTheme).theme)+ return tint+ ? ({ '--term-glass-bg': tint.background, '--term-glass-header-bg': tint.header } as React.CSSProperties)+ : null+ }, [glass, visual.terminalTheme])// The account list, for the chip and for the READERS below: a config dir the user links while// this pane sits quiet must resolve to its new account immediately, not at the next hook event.const claudeAccounts = useSettings((s) => s.settings.claudeAccounts)@@ -2099,7 +2112,7 @@ export function TerminalNode({const s = useSettings.getState().settings// Appearance comes from ONE place, shared with the kanban card modal's viewer of this same// session (`ModalTerminal`) — see `xtermOptionsFromSettings`.- const term = parked?.term ?? new Terminal(xtermOptionsFromSettings(s))+ const term = parked?.term ?? new Terminal(xtermOptionsFromSettings(s, s.glassTerminals === true))// Only on a FRESH instance: a parked terminal already carries the table, and the buffer it kept// alive was measured with it — re-registering under a live buffer buys nothing.if (!parked) activateUnicode11(term)@@ -4840,10 +4853,10 @@ export function TerminalNode({useEffect(() => {const term = termRef.currentif (!term) return- const { metricsChanged, themeChanged } = applyLiveOptions(term, visual)+ const { metricsChanged, themeChanged } = applyLiveOptions(term, visual, glass)if (metricsChanged) applyFitRef.current?.()if (themeChanged) fullRepaintRef.current?.()- }, [visual])+ }, [visual, glass])// glyphgrid participation — whether this node should hold a grid RIGHT NOW.//@@ -5295,9 +5308,11 @@ export function TerminalNode({isUnread ? ' unread' : ''}${status?.state === 'working' ? ' working' : ''}${status?.state === 'waiting' || status?.state === 'blocked' ? ' attention' : ''- }${glyphMounted ? ' term-node--glyphgrid' : ''}${focused ? ' term-node--focused' : ''}`}+ }${glyphMounted ? ' term-node--glyphgrid' : ''}${focused ? ' term-node--focused' : ''}${+ glassVars ? ' term-node--glass' : ''+ }`}ref={rootRef}- style={{ borderTopColor: data.color }}+ style={glassVars ? { ...glassVars, borderTopColor: data.color } : { borderTopColor: data.color }}onMouseEnter={() => (hoveredRef.current = true)}onMouseLeave={() => (hoveredRef.current = false)}>diff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex c0d2b9bc0..dfc26e513 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -1457,6 +1457,34 @@ body,box-shadow: 0 8px 28px rgba(0, 0, 0, calc(0.4 * var(--shadow-k)));}+/* Glass terminal nodes (Settings → Appearance → Glass terminals). The node fill is the terminal+ theme's background at an alpha computed per theme (`--term-glass-bg`, set inline by+ TerminalNode from lib/glassContrast.ts) so the theme foreground keeps 4.5:1 over ANY backdrop —+ the blur makes the wallpaper legible as colour, the alpha is what keeps text readable. xterm+ paints no background in this mode (terminal-config.ts `glassTheme`), so the body must not+ either. Declared BEFORE .selected/.unread so their border and glow still win. The top border+ keeps the node's colour; the specular highlight rides the header (the header's own fill would+ cover an inset shadow on the node). */+.term-node.term-node--glass {+ background: var(--term-glass-bg);+ -webkit-backdrop-filter: blur(28px) saturate(170%);+ backdrop-filter: blur(28px) saturate(170%);+ border-color: rgba(255, 255, 255, 0.18);+ border-radius: 14px;+ box-shadow:+ 0 12px 40px rgba(0, 0, 0, calc(0.35 * var(--shadow-k))),+ 0 1px 3px rgba(0, 0, 0, calc(0.25 * var(--shadow-k)));+}+.term-node--glass .term-node__header {+ background: var(--term-glass-header-bg);+ box-shadow:+ inset 0 1px 0 rgba(255, 255, 255, 0.28),+ inset 0 -1px 0 rgba(255, 255, 255, 0.06);+}+.term-node--glass .term-node__body {+ background: transparent;+}+.term-node.selected {border-color: var(--accent);}diff --git a/src/renderer/styles.theme.test.ts b/src/renderer/styles.theme.test.tsindex b72113369..0b55ada10 100644--- a/src/renderer/styles.theme.test.ts+++ b/src/renderer/styles.theme.test.ts@@ -106,6 +106,8 @@ describe('every CSS variable resolves', () => {// typo — unless the renderer sets it at runtime.const SET_FROM_JS = new Set(['--term-bg', // App.tsx, from the terminal theme+ '--term-glass-bg', // TerminalNode, glass tint per node theme (lib/glassContrast.ts)+ '--term-glass-header-bg','--peer-color', // presence chips, per peer'--group-label-boost', // GroupNode, zoom-compensated label size'--mascot-w',diff --git a/src/renderer/terminal/terminal-config.test.ts b/src/renderer/terminal/terminal-config.test.tsindex fe4f1719d..7be6a7c18 100644--- a/src/renderer/terminal/terminal-config.test.ts+++ b/src/renderer/terminal/terminal-config.test.ts@@ -930,6 +930,23 @@ describe('applyLiveOptions', () => {expect(term.writes).toEqual([])})+ it('glass toggles live: transparent background + allowTransparency on, and back off', () => {+ const s = visual()+ const term = fakeTerm(s)+ const on = applyLiveOptions(term, s, true)+ expect(on).toEqual({ metricsChanged: false, themeChanged: true })+ expect(term.options.allowTransparency).toBe(true)+ expect(term.options.theme?.background).toBe('#1e1e1e00')+ // Theme identity is stable while glass stays on, so a re-option is a no-op.+ term.writes.length = 0+ expect(applyLiveOptions(term, s, true).themeChanged).toBe(false)+ expect(term.writes).toEqual([])+ const off = applyLiveOptions(term, s, false)+ expect(off.themeChanged).toBe(true)+ expect(term.options.allowTransparency).toBe(false)+ expect(term.options.theme?.background).toBe('#1e1e1e')+ })+it('applies a font size change and reports metricsChanged', () => {const term = fakeTerm(visual())const r = applyLiveOptions(term, visual({ fontSize: 16 }))diff --git a/src/renderer/terminal/terminal-config.ts b/src/renderer/terminal/terminal-config.tsindex c83efca18..47762489a 100644--- a/src/renderer/terminal/terminal-config.ts+++ b/src/renderer/terminal/terminal-config.ts@@ -325,6 +325,31 @@ export interface XtermVisualOptions {letterSpacing: numberscrollback: numbertheme: ITheme+ allowTransparency?: boolean+}++/**+ * Glass terminals (Settings → Appearance): the node paints the theme background as a translucent+ * tint behind the terminal (see `lib/glassContrast.ts`), so xterm itself must paint NO background —+ * the theme's background with its alpha zeroed, plus `allowTransparency` so the WebGL glyph atlas+ * is rasterized without a baked-in background (addon-webgl's `_getBackgroundColor`).+ *+ * The RGB is kept and only the alpha zeroed, so anything xterm derives from the background+ * (minimum-contrast adjustment, the cursor accent) still sees the tint's colour, not black.+ *+ * Memoized per theme object: `applyLiveOptions` compares themes by IDENTITY, so a fresh object per+ * call would re-apply the theme — a full palette rebuild on every terminal — on every settings edit.+ */+const glassThemes = new WeakMap<ITheme, ITheme>()+export function glassTheme(theme: ITheme): ITheme {+ let t = glassThemes.get(theme)+ if (!t) {+ const bg = theme.background+ const rgb = bg && /^#[0-9a-f]{6}$/i.test(bg) ? bg : '#000000'+ t = Object.freeze({ ...theme, background: `${rgb}00` })+ glassThemes.set(theme, t)+ }+ return t}/**@@ -335,8 +360,11 @@ export interface XtermVisualOptions {* else — the point is that there is no per-site options literal left to drift.*/export function xtermOptionsFromSettings(- s: XtermVisualSettings+ s: XtermVisualSettings,+ /** Glass terminal node (canvas only — the card modal and the settings preview never pass it). */+ glass = false): XtermVisualOptions & { allowProposedApi: true; macOptionClickForcesSelection: true } {+ const theme = resolveTerminalTheme(s.terminalTheme).themereturn {fontFamily: s.fontFamily,fontSize: s.fontSize,@@ -354,7 +382,9 @@ export function xtermOptionsFromSettings(// tmux's own history (see pty-manager's tmuxConf). This buffer backs the plain-shell// fallback (tmux unavailable) and the cold-snapshot replay. Capped: per node, many nodes.scrollback: xtermScrollback(s.tmuxScrollback),- theme: resolveTerminalTheme(s.terminalTheme).theme,+ theme: glass ? glassTheme(theme) : theme,+ // Only present when on, so a non-glass terminal's options are exactly what they were.+ ...(glass ? { allowTransparency: true } : {}),allowProposedApi: true,// Inside an app that requested mouse tracking (vim, htop) a plain drag goes to the app;// Option/Alt forces a selection instead (Shift does the same via xterm's own bypass).@@ -395,9 +425,10 @@ export interface LiveOptionEffects {*/export function applyLiveOptions(term: LiveOptionTarget,- s: XtermVisualSettings+ s: XtermVisualSettings,+ glass = false): LiveOptionEffects {- const next = xtermOptionsFromSettings(s)+ const next = xtermOptionsFromSettings(s, glass)const o = term.options// Deliberately NOT including the font WEIGHTS. xterm derives its cell size from// `CharSizeService`, which re-measures only on `fontFamily`/`fontSize` — a weight change never@@ -430,6 +461,10 @@ export function applyLiveOptions(o.cursorInactiveStyle = next.cursorInactiveStyle}if (o.scrollback !== next.scrollback) o.scrollback = next.scrollback+ // Before the theme, in the same synchronous pass: the WebGL renderer rebuilds its atlas on every+ // option change, and the two must land together or one frame paints a transparent background+ // over glyphs rasterized onto an opaque one.+ if ((o.allowTransparency ?? false) !== glass) o.allowTransparency = glassif (themeChanged) o.theme = next.themereturn { metricsChanged, themeChanged }