Parent
Epic: #426
Summary
Strip ANSI escape sequences and progress bar output from all tool outputs as a baseline preprocessing step before command-specific filters.
Expected Savings
5-15% baseline on all outputs, 85-95% on progress-heavy commands (cargo build with progress, wget, pip install).
Behavior
- Strip all ANSI escape codes:
\x1b\[[0-9;]*[a-zA-Z]
- Strip carriage return progress lines: lines ending with
\r that rewrite the same terminal line
- Collapse consecutive blank lines to max 2
- Strip common progress patterns:
[=====> ] 45%, Downloading..., Compiling N/M
Implementation
sanitize_output(raw: &str) -> String function in filter.rs, applied before any command-specific filter
- Should be fast (single-pass regex or manual char iteration)
- Already partially handled by terminal — verify what
execute_bash captures vs raw PTY
Acceptance Criteria
Parent
Epic: #426
Summary
Strip ANSI escape sequences and progress bar output from all tool outputs as a baseline preprocessing step before command-specific filters.
Expected Savings
5-15% baseline on all outputs, 85-95% on progress-heavy commands (cargo build with progress, wget, pip install).
Behavior
\x1b\[[0-9;]*[a-zA-Z]\rthat rewrite the same terminal line[=====> ] 45%,Downloading...,Compiling N/MImplementation
sanitize_output(raw: &str) -> Stringfunction infilter.rs, applied before any command-specific filterexecute_bashcaptures vs raw PTYAcceptance Criteria