fix: strip ANSI sequences in footer tool status labels to prevent raw escape code leaks (#2481)
This commit is contained in:
@@ -398,8 +398,10 @@ fn collect_active_tool_status(cell: &HistoryCell, snapshot: &mut ActiveToolStatu
|
||||
}
|
||||
|
||||
pub(crate) fn one_line_summary(text: &str, max_width: usize) -> String {
|
||||
let mut cleaned = String::with_capacity(text.len());
|
||||
crate::tui::osc8::strip_ansi_into(text, &mut cleaned);
|
||||
truncate_line_to_width(
|
||||
&text.split_whitespace().collect::<Vec<_>>().join(" "),
|
||||
&cleaned.split_whitespace().collect::<Vec<_>>().join(" "),
|
||||
max_width,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -72,7 +72,9 @@ pub(crate) fn concise_shell_command_label(command: &str, max_width: usize) -> St
|
||||
}
|
||||
|
||||
fn normalize_shell_text(text: &str) -> String {
|
||||
text.split_whitespace().collect::<Vec<_>>().join(" ")
|
||||
let mut cleaned = String::with_capacity(text.len());
|
||||
crate::tui::osc8::strip_ansi_into(text, &mut cleaned);
|
||||
cleaned.split_whitespace().collect::<Vec<_>>().join(" ")
|
||||
}
|
||||
|
||||
fn actionable_shell_segment(command: &str) -> Option<String> {
|
||||
|
||||
Reference in New Issue
Block a user