From b41d710a35adb3e088813bd25ba37ff588a9ad2d Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 8 Sep 2025 18:44:16 -0300 Subject: [PATCH] fix: Use ASCII_FULL for tables when stdout is not a TTY Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/modes/common.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modes/common.rs b/src/modes/common.rs index 6bbd7a2..ce04764 100644 --- a/src/modes/common.rs +++ b/src/modes/common.rs @@ -146,9 +146,13 @@ pub fn create_table(use_styling: bool) -> Table { table.set_content_arrangement(ContentArrangement::Dynamic); if use_styling { - table - .load_preset(comfy_table::presets::UTF8_FULL) - .apply_modifier(comfy_table::modifiers::UTF8_SOLID_INNER_BORDERS); + if std::io::stdout().is_terminal() { + table + .load_preset(comfy_table::presets::UTF8_FULL) + .apply_modifier(comfy_table::modifiers::UTF8_SOLID_INNER_BORDERS); + } else { + table.load_preset(comfy_table::presets::ASCII_FULL); + } } else { table.load_preset(comfy_table::presets::NOTHING); }