-
Notifications
You must be signed in to change notification settings - Fork 83
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
Work with moving sequences #168
Work with moving sequences #168
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, especially for adding tests! The change seems ok to me, this is pretty much what I proposed at the end of #151 (comment).
I added one minor comment, and I think we might as well override all methods on AnsiOutputStream
that are not already overridden by AnsiHtmlOutputStream
at the same time to do the same thing. What do you think?
src/main/java/hudson/plugins/ansicolor/AnsiHtmlOutputStream.java
Outdated
Show resolved
Hide resolved
…her special values. Override all remaining AnsiOutputStream methods to emit invisible sequences
I've provided additional adjustments so closing the original conversation.
@dwnusbaum what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tszmytka The changes look great to me, thanks for adding tests for everything!
*/ | ||
default void emitRedundantReset() { } | ||
default void emitInvisibleSequence() { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This breaks binary compatibility. We could avoid it by keeping emitRedundantReset
and having it call emitInvisibleSequence
internally, but it doesn't look like emitRedundantReset
was ever used by any other plugins, so I think the change is fine as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This breaks binary compatibility.
Are there other plugins extending ansicolor-plugin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updatebot plugin implements AnsiAttributeElement.Emitter
(the usage looks weird, it probably shouldn't be extending ansicolor), but the plugin looks obsolete and has less than 50 installs, so I think it can be ignored.
Do I need to do anything else in order to merge this? |
…color-plugin into work-with-moving-sequences
@dwnusbaum All done. Thanks for the help. |
@tszmytka Thanks for fixing the bug! |
Currently the plugin incorrectly handles control sequences like:
CUU
Cursor UpCUD
Cursor DownCUF
Cursor ForwardCUB
Cursor BackEL
Erase in LineUsing many popular tools in a job, like
docker
, produces output similar to:This PR contains a fix - the mentioned sequences will not produce any output - as well as a test case against regression.
Merging this may very well fix #151 as the actual problem looks very similar.