fix(tui): replace hardcoded colors with Color::Reset for terminal compatibility (closes #666)

This commit is contained in:
wangfeng
2026-05-04 18:21:15 -07:00
parent 3cff070570
commit b6a6c88327
4 changed files with 6 additions and 2 deletions
+1
View File
@@ -196,6 +196,7 @@ alternate_screen = "auto" # auto | always | never
mouse_capture = true # true copies only transcript user/assistant text; false uses raw terminal selection/copy
terminal_probe_timeout_ms = 500 # optional startup terminal-mode timeout (100-5000ms)
osc8_links = true # emit OSC 8 escapes around URLs (Cmd+click in iTerm2/Ghostty/Kitty/WezTerm/Terminal.app 13+); set false for terminals that misrender
# use_terminal_colors = false # set true to let your terminal's color scheme take full control
# ─────────────────────────────────────────────────────────────────────────────────
# Feature Flags
+3
View File
@@ -343,6 +343,9 @@ pub struct TuiConfig {
/// label and ignore the escape. Defaults to `true`; set `false` for
/// terminals that misrender the sequence.
pub osc8_links: Option<bool>,
/// When true, TUI uses Color::Reset everywhere and defers all color decisions
/// to the terminal emulator. Useful for terminals with custom color schemes.
pub use_terminal_colors: Option<bool>,
}
/// Notification delivery method (mirrors `tui::notifications::Method`).
+1 -1
View File
@@ -385,7 +385,7 @@ impl ModalView for PagerView {
Color::DarkGray
};
let fg = if is_current {
Color::Black
Color::Reset
} else {
Color::Yellow
};
+1 -1
View File
@@ -1363,7 +1363,7 @@ fn apply_detail_target_highlight(
target_cell: usize,
line_meta: &[TranscriptLineMeta],
) {
let highlight_bg = Color::Rgb(18, 29, 39);
let highlight_bg = Color::Reset;
for (idx, line) in lines.iter_mut().enumerate() {
let line_index = top + idx;
if let Some(TranscriptLineMeta::CellLine { cell_index, .. }) = line_meta.get(line_index)