When the terminal window is too small, lldb would wrap progress messages
accross multiple lines which would break the progress event handling
code that is supposed to clear the message once the progress is completed.
This causes the progress message to remain on the screen, sometimes partially,
which can be confusing for the user.
To fix this issue, this patch trims the progress message to the terminal
width taking into account the progress counter leading the message for
finite progress events and also the trailing ....
rdar://91993836
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Should this account for the control characters? Do they cause a line wrap?