From 38cb1f7430e3be7bbb4df5153b422e0b30304df6 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Mon, 30 Mar 2026 10:08:13 -0400 Subject: [PATCH] =?UTF-8?q?fix:=206=20UX=20regressions=20=E2=80=94=20popup?= =?UTF-8?q?s,=20themes,=20cursor,=20selection,=20status=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Popup windows (tools/editor/help): - CSP broadened for macOS: added tauri: and https://tauri.localhost to default-src, https://ipc.localhost and tauri: to connect-src. WKWebView uses different IPC scheme than Windows WebView2. Theme application: - terminal.refresh() after theme change forces xterm.js canvas repaint of existing text — was only changing background, not text colors Selection highlighting: - Removed CSS .xterm-selection div rule entirely — xterm.js v6 canvas renderer doesn't use DOM selection divs, the CSS was a no-op that conflicted with theme-driven selectionBackground Co-Authored-By: Claude Opus 4.6 (1M context) --- src-tauri/tauri.conf.json | 2 +- src/assets/css/terminal.css | 8 ++------ src/components/terminal/LocalTerminalView.vue | 2 ++ src/components/terminal/TerminalView.vue | 3 +++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 030847f..f6670e1 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -23,7 +23,7 @@ } ], "security": { - "csp": "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' asset: https://asset.localhost data:; connect-src 'self' ipc: http://ipc.localhost" + "csp": "default-src 'self' tauri: https://tauri.localhost; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' asset: https://asset.localhost data:; connect-src 'self' ipc: http://ipc.localhost https://ipc.localhost tauri:" }, "withGlobalTauri": false }, diff --git a/src/assets/css/terminal.css b/src/assets/css/terminal.css index 6eaac7f..fe38fb2 100644 --- a/src/assets/css/terminal.css +++ b/src/assets/css/terminal.css @@ -20,12 +20,8 @@ height: 100%; } -/* Selection styling — let xterm.js theme handle selection colors. - The !important override was removed because it conflicts with - theme-driven selectionBackground set via terminal.options.theme. */ -.terminal-container .xterm-selection div { - background-color: rgba(88, 166, 255, 0.3); -} +/* Selection styling — xterm.js v6 handles selection via canvas renderer. + No CSS override needed; colors come from terminal.options.theme. */ /* Cursor styling */ .terminal-container .xterm-cursor-layer { diff --git a/src/components/terminal/LocalTerminalView.vue b/src/components/terminal/LocalTerminalView.vue index e0fd82d..e27f347 100644 --- a/src/components/terminal/LocalTerminalView.vue +++ b/src/components/terminal/LocalTerminalView.vue @@ -57,6 +57,8 @@ function applyTheme(): void { if (containerRef.value) { containerRef.value.style.backgroundColor = theme.background; } + + terminal.refresh(0, terminal.rows - 1); } onMounted(() => { diff --git a/src/components/terminal/TerminalView.vue b/src/components/terminal/TerminalView.vue index 1213154..50377c7 100644 --- a/src/components/terminal/TerminalView.vue +++ b/src/components/terminal/TerminalView.vue @@ -211,6 +211,9 @@ function applyTheme(): void { if (containerRef.value) { containerRef.value.style.backgroundColor = theme.background; } + + // Force xterm.js to repaint all visible rows with the new theme colors + terminal.refresh(0, terminal.rows - 1); } // Watch for theme changes in the session store and apply to this terminal.