You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromrichimporttexttext.Text("aaa\bx\ry") # would give <text 'yax' []>
Once ANSI control characters are removed from the plain text, this can easily be achieved in the Text() class constructor by overwriting the last character of the current line when encountering \b, and starting overwriting characters from the beginning of the line when encountering \r.
What problem does it solve for you?
This would significantly improve the ability for the Text.from_ansi() method to parse bash command outputs.
Note
To do this, \r and \b should be removed from the STRIP_CONTROL_CODES list and few lines from ansi.py should be modified.
I wanted to create a pull request, but I'm uncertain if integrating this functionality into the Text() constructor is an appropriate approach. I would appreciate guidance on where to implement this feature and what aspects should remain unaltered to ensure compatibility.
The text was updated successfully, but these errors were encountered:
How would you improve Rich?
Adding support for \r and \b, such as
Once ANSI control characters are removed from the plain text, this can easily be achieved in the Text() class constructor by overwriting the last character of the current line when encountering \b, and starting overwriting characters from the beginning of the line when encountering \r.
What problem does it solve for you?
This would significantly improve the ability for the
Text.from_ansi()
method to parse bash command outputs.Note
To do this, \r and \b should be removed from the STRIP_CONTROL_CODES list and few lines from
ansi.py
should be modified.I wanted to create a pull request, but I'm uncertain if integrating this functionality into the Text() constructor is an appropriate approach. I would appreciate guidance on where to implement this feature and what aspects should remain unaltered to ensure compatibility.
The text was updated successfully, but these errors were encountered: