Skip to content

Commit ed0fa6c

Browse files
committed
refactor: update PTY fallback handling for consistent terminal output
1 parent 387a45c commit ed0fa6c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

vtcode-tui/src/core_tui/session/message_renderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ pub(super) fn render_message_spans(
5353
// Render PTY content with a subdued foreground color instead of the
5454
// terminal DIM modifier, which can be too faint on many terminals.
5555
// Segments that carry their own ANSI color keep it; uncolored segments
56-
// get the theme's pty_body color for consistent, readable contrast.
57-
let pty_fallback = theme.pty_body.or(theme.foreground);
56+
// use the configured PTY fallback chain from session styling.
57+
let pty_fallback = text_fallback_fn(InlineMessageKind::Pty).or(theme.foreground);
5858
for segment in &line.segments {
5959
let style = ratatui_pty_style_from_inline(&segment.style, pty_fallback);
6060
spans.push(Span::styled(segment.text.clone(), style));

vtcode-tui/src/core_tui/session/reflow/blocks.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ impl Session {
401401
}
402402

403403
// Render body content - strip ANSI codes to ensure plain text output.
404-
// Use the theme's pty_body color as fallback instead of terminal DIM
405-
// for consistent, readable contrast across terminals.
406-
let pty_fallback = self.theme.pty_body.or(self.theme.foreground);
404+
// Use the session PTY fallback chain (pty_body -> tool_body -> foreground)
405+
// and apply a consistent dimmed style for terminal output.
406+
let pty_fallback = self
407+
.text_fallback(InlineMessageKind::Pty)
408+
.or(self.theme.foreground);
407409
let mut body_spans = Vec::new();
408410
for segment in &line.segments {
409411
let stripped_text = render::strip_ansi_codes(&segment.text);

0 commit comments

Comments
 (0)