-
Notifications
You must be signed in to change notification settings - Fork 659
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
src/molecule/console.py: Don't always set output wrapping #2993
Conversation
The output soft wrapping with python enrich is enabled for all terminals. This means that lines are wrapped to 80 when molecule is run from tox or when a module ends importing this console module. In the later case, this will wrap its output to 80 columns and possibly break it, since the output won't be valid JSON as found in ansible-community/molecule-vagrant#84. As a possible solution, enable the soft wrapping on the same condition as for the force_terminal terminal. Signed-off-by: Arnaud Patard <apatard@hupstream.com>
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.
I think the option name confused you because soft_wrap=True means do not wrap. soft_wrap=False means wrap at terminal width, default behavior on rich.
Default behavior of enrich.console.Console is to soft_wrap=True (not wrapping). Is one of the reasons I created enrich.
If is not working like this maybe there is a bug we need to fix, but we should not need to ever manually set soft_wrap=False.
ok, so a bug in enrich ?
This leads to tox output looking like:
and also breaks molecule-vagrant |
Fixed with enrich 1.2.3, so this PR is useless. I'm closing it. |
The output soft wrapping with python enrich is enabled for all
terminals. This means that lines are wrapped to 80 when molecule
is run from tox or when a module ends importing this console module.
In the later case, this will wrap its output to 80 columns and
possibly break it, since the output won't be valid JSON as found in
ansible-community/molecule-vagrant#84.
As a possible solution, enable the soft wrapping on the same condition
as for the force_terminal terminal.
Signed-off-by: Arnaud Patard apatard@hupstream.com
PR Type