Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lastGrep should ignore ANSI escape sequences #4840

Open
szeiger opened this issue Jun 26, 2019 · 1 comment
Open

lastGrep should ignore ANSI escape sequences #4840

szeiger opened this issue Jun 26, 2019 · 1 comment

Comments

@szeiger
Copy link
Contributor

szeiger commented Jun 26, 2019

sbt version: 1.2.8

lastGrep greps the raw output, including any ANSI color sequences, which leads to unexpected and unwanted effects, e.g.:

sbt:root> lastGrep error.* library/mimaReportBinaryIssues
[error]  * method foo()Int in class scala.collection.immutable.BitSet does not have a correspondent in other version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.BitSet.foo")
sbt:root> lastGrep \[.*error.* library/mimaReportBinaryIssues
[0m[error]  * method foo()Int in class scala.collection.immutable.BitSet does not have a correspondent in other version
[0m[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.BitSet.foo")
sbt:root> lastGrep \[error.* library/mimaReportBinaryIssues
sbt:root>

error is red in this case, eveything else has the default color, so there are at least two escape sequences per line, one to switch to red and the other one to switch back.

It would be more useful to filter out all escape sequences and grep the filtered output.

Bonus points for keeping track of all ANSI attributes, mapping the positions back to the attributed soutce, and synthesizing a new escaped version.

@szeiger szeiger added the Bug label Jun 26, 2019
@eed3si9n
Copy link
Member

@szeiger Thanks for the report.

It would be more useful to filter out all escape sequences and grep the filtered output.

I agree with your expectation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants