-
Notifications
You must be signed in to change notification settings - Fork 300
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
Add dynamic MAX_PROGRESS_WIDTH
global variable to handle long lines
#435
Add dynamic MAX_PROGRESS_WIDTH
global variable to handle long lines
#435
Conversation
It broken normal user case. Print may mass when use correct console. Generally, if uuu work as subprocess, use -v option to print raw log to easy parser by other program. |
Hi @nxpfrankli, thanks for your fast reply. Proposed patch does not break anything when using |
c3a23e4
to
1e6de1f
Compare
75515bc
to
377eb79
Compare
Please add signed-off at your each commit |
Fix long line issue when using `uuu` outside of a terminal. eg: python.subprocess. Signed-off-by: Thomas Mahé <[email protected]>
Signed-off-by: Thomas Mahé <[email protected]>
Signed-off-by: Thomas Mahé <[email protected]>
Signed-off-by: Thomas Mahé <[email protected]>
377eb79
to
ee36e09
Compare
Done |
Description
Add dynamic
MAX_PROGRESS_WIDTH
global variable that will store longest line printed during progress phase.Use as a replacement of
get_console_width
while sizing string during progress.Initialized with
0
,MAX_PROGRESS_WIDTH
is updated on each progress step with actual line length as follow:MAX_PROGRESS_WIDTH = MAX(MAX_PROGRESS_WIDTH, next_content_length)
Which warranty that next line even if shorter will contains required spaces in order to flush previous lines (while using terminal).
Outside of a terminal context, lines will have a maximum length based on actual output and not on nonexistent terminal size.
Fixes #434
Type of change
How Has This Been Tested?
Tested by flashing firmware i.MX board with manual checking of standard output.
Example output
Test Configuration: