fix(frontend): preserve ansi colors in terminal effects

Limit stroke and shadow effects to default-foreground terminal text so
ANSI-colored output keeps its intended visual meaning.

Also enable terminal text stroke and shadow by default in frontend and
backend fallbacks, and align the dark preset and default xterm theme
with the new green night palette.
This commit is contained in:
yinjianm
2026-03-25 06:20:33 +08:00
parent d74e84c87b
commit 7e430cb983
18 changed files with 338 additions and 75 deletions
@@ -185,12 +185,12 @@ const getDefaultAppearanceSettings = (): Omit<AppearanceSettings, '_id'> => {
terminal_custom_html: '', // 默认自定义 HTML 为空字符串
remoteHtmlPresetsUrl: null, // 默认远程 HTML 预设 URL 为 null
// 终端文本描边设置默认值
terminalTextStrokeEnabled: false,
terminalTextStrokeEnabled: true,
terminalTextStrokeWidth: 1,
terminalTextStrokeColor: '#000000',
// 终端文本阴影设置默认值
terminalTextShadowEnabled: false,
terminalTextShadowEnabled: true,
terminalTextShadowOffsetX: 2,
terminalTextShadowOffsetY: 2,
terminalTextShadowBlur: 0,
+20 -20
View File
@@ -3,26 +3,26 @@ import type { ITheme } from 'xterm';
// 默认 xterm 主题
// (与 backend/src/config/default-themes.ts 中的定义保持一致)
export const defaultXtermTheme: ITheme = {
background: '#1e1e1e',
foreground: '#d4d4d4',
cursor: '#d4d4d4',
selectionBackground: '#264f78',
black: '#000000',
red: '#cd3131',
green: '#0dbc79',
yellow: '#e5e510',
blue: '#2472c8',
magenta: '#bc3fbc',
cyan: '#11a8cd',
white: '#e5e5e5',
brightBlack: '#666666',
brightRed: '#f14c4c',
brightGreen: '#23d18b',
brightYellow: '#f5f543',
brightBlue: '#3b8eea',
brightMagenta: '#d670d6',
brightCyan: '#29b8db',
brightWhite: '#e5e5e5'
background: '#111411',
foreground: '#d8e6d2',
cursor: '#8ff7a7',
selectionBackground: '#21462b',
black: '#111411',
red: '#d96c5f',
green: '#59d971',
yellow: '#d8ba52',
blue: '#4ca89f',
magenta: '#6f8f8a',
cyan: '#4ec9b0',
white: '#d8e6d2',
brightBlack: '#5d685b',
brightRed: '#f07d6c',
brightGreen: '#7df79b',
brightYellow: '#ead17a',
brightBlue: '#76d0c8',
brightMagenta: '#92b8b2',
brightCyan: '#7ae7d6',
brightWhite: '#f3fff0'
};
// 默认 UI 主题 (CSS 变量)