-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BUG] Full-width content missing newline #3039
Comments
Update: I just tested this in xfce4-terminal on Alpine Linux in a VM, and everything works as expected. Working as expected in xfce4-terminalIncluding platform details from Alpine Click to expand
|
This is an idiosyncrasy of Windows. You can reproduce it without Rich: >>> import os
>>> width, _ = os.get_terminal_size()
>>> print("X" * width + "\nYYYYYYY") I don't think Windows stores the new line characters at all. When you copy text it treats a run of spaces on the right as a new line, but if text goes all the way to the end it is assumed to be part of a single line. |
Oh that's truly awful! Thank you. I'll open a bug with Windows Terminal. e.g. import os
width, _ = os.get_terminal_size()
print("X" * (width-1) + " \nYYYYYYYY") |
Tracked down the existing Windows Terminal bug: Closing this issue as not a rich bug. |
I hope we solved your problem. If you like using Rich, you might also enjoy Textual |
Describe the bug
Full width content appears to be missing the newline character, so increasing the width of the terminal after printing scrambles the output. Observe in the screenshots below that the narrow table remains nicely formatted when the width of the terminal is increased, but the full-width table wraps as if there are no newlines at the end of the line.
Note that this occurs for any full-width content, not just tables.
Original output:
After increasing width of terminal:
I'm questioning myself now.
If I copy the text from the terminal and paste it below, it looks like it does contain newlines.
But if I resize the terminal first, then copy it, it looks like it doesn't contain newlines?!
Is this perhaps a Windows Terminal bug rather than a rich bug?
Copied from original terminal width:
Copied after increasing terminal width:
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
The text was updated successfully, but these errors were encountered: