From 7cbd3c2a748ef2a505f57fb7e8b161094a6d0374 Mon Sep 17 00:00:00 2001 From: kekxv Date: Tue, 18 Aug 2026 06:10:15 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix(globals.css):=20=E4=BC=98=E5=8C=96=20xt?= =?UTF-8?q?erm=20=E8=A7=86=E5=8F=A3=E8=83=8C=E6=99=AF=E5=A4=84=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E8=83=8C=E6=99=AF=E5=9B=BE=E5=92=8C?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=89=B2=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 8e2e58466..5554e19b5 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1209,10 +1209,21 @@ /* 终端画布:让 xterm 视口透出所属 ws-surface 面板的磨砂表面(而非黑块)。xterm 6 的视口 分两层——外层 .xterm-viewport(xterm.css 硬编码 background-color:#000,且不随主题变化) 套着内层 SmoothScrollableElement 节点(终端主题背景色应用在这层)。terminal-view.tsx 已把 - 内层主题背景改成 alpha 0(透明),但外层那层黑底会透出来,终端仍是黑块。这里把外层也改 - 透明——两层皆透,终端画布才透出下方磨砂面板。选择器 .xterm .xterm-viewport 特异性(0,3,0) - 高于 xterm.css 同名规则(0,2,0),无需 !important;纯透明不依赖 color-mix,关图无此规则, - 零回归。 */ + 内层主题背景改成 alpha 0(透明),但外层那层黑底会透出来,终端仍是黑块。 + + 两种情形的处理方式: + 1. 不启用背景图时:用主题背景色覆盖外层黑色,使终端在亮色主题下显示白色背景,暗色主题下 + 显示深灰背景。选择器特异性(0,3,0)高于 xterm.css(0,2,0),无需 !important。 + 2. 启用背景图时:外层改透明,两层皆透,终端画布透出下方磨砂面板。 + + 零回归:关图或未设背景属性时无此规则或不匹配。 */ + +/* 不启用背景图:用主题背景色覆盖 xterm-viewport 的硬编码黑色 */ +:not([data-workspace-bg="on"]) .xterm .xterm-viewport { + background-color: var(--background); +} + +/* 启用背景图:外层改透明让画布透出磨砂面板 */ [data-workspace-bg="on"] .xterm .xterm-viewport { background-color: transparent; } From 4624f8c8e389dd01753f6a2e4a3b4f7bb7d54bab Mon Sep 17 00:00:00 2001 From: kekxv Date: Tue, 18 Aug 2026 06:27:05 +0000 Subject: [PATCH 2/2] =?UTF-8?q?fix(globals.css):=20=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=A6=86=E7=9B=96=20xterm=20=E5=86=85=E8=81=94=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BB=A5=E6=94=AF=E6=8C=81=E4=B8=BB=E9=A2=98=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/globals.css | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 5554e19b5..e10aac6ca 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1206,26 +1206,25 @@ background-color: transparent; } -/* 终端画布:让 xterm 视口透出所属 ws-surface 面板的磨砂表面(而非黑块)。xterm 6 的视口 - 分两层——外层 .xterm-viewport(xterm.css 硬编码 background-color:#000,且不随主题变化) - 套着内层 SmoothScrollableElement 节点(终端主题背景色应用在这层)。terminal-view.tsx 已把 - 内层主题背景改成 alpha 0(透明),但外层那层黑底会透出来,终端仍是黑块。 +/* 终端画布:xterm 6 在运行时会给内层 .xterm-scrollable-element 设置内联样式 + style="background-color: rgb(0, 0, 0)"(黑色),这会覆盖 CSS 规则。需要用 !important + 来强制覆盖这个内联样式,使终端背景色跟随主题。 两种情形的处理方式: - 1. 不启用背景图时:用主题背景色覆盖外层黑色,使终端在亮色主题下显示白色背景,暗色主题下 - 显示深灰背景。选择器特异性(0,3,0)高于 xterm.css(0,2,0),无需 !important。 - 2. 启用背景图时:外层改透明,两层皆透,终端画布透出下方磨砂面板。 + 1. 不启用背景图时:用主题背景色覆盖 .xterm-scrollable-element 的内联黑色,使终端在 + 亮色主题下显示白色背景,暗色主题下显示深灰背景。需要 !important 压过内联样式。 + 2. 启用背景图时:改为透明背景,两层皆透,让终端画布透出下方磨砂面板。 零回归:关图或未设背景属性时无此规则或不匹配。 */ -/* 不启用背景图:用主题背景色覆盖 xterm-viewport 的硬编码黑色 */ -:not([data-workspace-bg="on"]) .xterm .xterm-viewport { - background-color: var(--background); +/* 不启用背景图:用主题背景色覆盖 xterm-scrollable-element 的运行时内联黑色 */ +:not([data-workspace-bg="on"]) .xterm .xterm-scrollable-element { + background-color: var(--background) !important; } -/* 启用背景图:外层改透明让画布透出磨砂面板 */ -[data-workspace-bg="on"] .xterm .xterm-viewport { - background-color: transparent; +/* 启用背景图:改为透明让画布透出磨砂面板 */ +[data-workspace-bg="on"] .xterm .xterm-scrollable-element { + background-color: transparent !important; } /* Monaco sticky scroll(钉住的父级作用域行):开背景图时编辑器画布透明(WSBG_CANVAS_ALPHA=0),