fix(tui): replace hardcoded colors with Color::Reset + add use_terminal_colors config (#671)
This commit is contained in:
@@ -201,6 +201,7 @@ osc8_links = true # emit OSC 8 escapes around URLs (Cmd+click in iTer
|
||||
# # Override: `locale = "zh-Hans"` for Simplified Chinese regardless of OS locale.
|
||||
# # Also settable at runtime: /config locale zh-Hans
|
||||
# # Note: this only affects TUI labels/chrome — it does NOT change model output language.
|
||||
# use_terminal_colors = false # set true to let your terminal's color scheme take full control
|
||||
|
||||
# ─────────────────────────────────────────────────────────────────────────────────
|
||||
# Feature Flags
|
||||
|
||||
@@ -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`).
|
||||
|
||||
@@ -385,7 +385,7 @@ impl ModalView for PagerView {
|
||||
Color::DarkGray
|
||||
};
|
||||
let fg = if is_current {
|
||||
Color::Black
|
||||
Color::Reset
|
||||
} else {
|
||||
Color::Yellow
|
||||
};
|
||||
|
||||
@@ -1381,7 +1381,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)
|
||||
|
||||
Reference in New Issue
Block a user