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

#571 Make use of MessageUtils.getTerminalWidth when displayTerminalWidth is configured to -1 #572

Closed
wants to merge 1 commit into from

Conversation

stefanseifert
Copy link
Contributor

Fixes #571

making use of MessageUtils.getTerminalWidth is not the default behavior. i tested this method on different terminals on windows and got varying results:

  • works as expected in powershell and cmd
  • does not work in Git bash (the method returned 13249 instead of something about 150 - rendering completely unreadable results).

that's probably a bug https://github.com/fusesource/jansi, did not look deeper into this. as Git bash is quite popular on windows i advise not to enable this behavior by default.

@rfscholte WDYT?

@rfscholte
Copy link
Member

Well, Maven will use it as well for its output, so I'd suggest to file an issue at JAnsi, otherwise Maven will hit similar issues

@stefanseifert
Copy link
Contributor Author

that's strange as i'm using the latest version of Maven every day since years with git bash and never have seen such display problems. it seems getTerminalWidth() is not used for the usual use cases.

we also have to consider that the output of these goals may also be redirected to an outputfile, and in that case it might not be desirable to depend on the current terminal width.

@stefanseifert
Copy link
Contributor Author

i've created fusesource/jansi#233 for JANSI

if there are not objections i will merge the PR as-is, having the automatic JANSI terminal width support only optionally if configured explicitly (set to -1), because a) it's broken at least on git bash and windows and b) we have to consider the other output channels as well (e.g. output file).

@rfscholte
Copy link
Member

Well, it is up to you, I prefer to have a minimum set of parameters where possible. IMO switching to terminalWidth via JAnsi is already an improvement compared to what it was. Even 13249 is likely be better (and should be fixed), as I don't expect output with such long lines.
If you think controlling width of content in a file, don't call it terminalWidth, that's misleading.

@stefanseifert
Copy link
Contributor Author

the problem in this case is that the versions maven plugin uses the width to format the full line filled with "...". so instead of an output like

[INFO]   com.github.spotbugs:spotbugs-annotations .............. 4.5.3 -> 4.6.0

i get on git bash:

[INFO] com.github.spotbugs:spotbugs-annotations ...................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
...................................................................................................................................................................................................................
..................................................................................................................................................... 4.5.3 -> 4.6.0

which is completely unusable.

renaming the parameter is a good idea. the output as shown above is not very good readable even if ANSI terminal width is detected correctly because then the lines are rendered too wide in this style.

i will drop this PR and create an new one to rename the parameter to something more feasible.

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

Successfully merging this pull request may close these issues.

display-dependency/plugin/property-updates: Make use of MessageUtils.getTerminalWidth
2 participants