sbt/main
PandaMan 6d94d6db61
[2.x] fix: lastGrep ignores ANSI escape sequences when matching (#8726)
**Problem**
When `last` output includes ANSI escape sequences (e.g. colored `[error]` lines), `lastGrep <pattern>` was matching against the raw string. The pattern could fail to match because it was compared to text like `\u001B[31merror\u001B[0m` instead of `error`, or matching was inconsistent.

**Solution**
- Strip ANSI from each line before running the regex, using `EscHelpers.stripColorsAndMoves` from `sbt.internal.util`.
- **`Output.lastGrep`** (keys and file overloads): lines from the last run are stripped, then the pattern is applied to the stripped text; matching and printed lines are based on visible text.
- **`Output.grep`**: each line is stripped before `showMatches(pattern)` so the pattern is applied only to visible content.
2026-02-09 21:13:46 -08:00
..
src [2.x] fix: lastGrep ignores ANSI escape sequences when matching (#8726) 2026-02-09 21:13:46 -08:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00