-
Notifications
You must be signed in to change notification settings - Fork 323
RAW UTF-8 terminal: SI/SO/IBMPC_ON/IBMPC_OFF skip #787
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
Conversation
Pull Request Test Coverage Report for Build 7796628429
💛 - Coveralls |
Made extra synthetic tests for partial render: no signs of attributes mixing during render. |
@danschwarz please look at this. |
examples/palette_test.py
Outdated
# mode radio buttons | ||
rb = urwid.RadioButton(mode_radio_buttons, text, state) | ||
urwid.connect_signal(rb, "change", on_mode_change, colors) |
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.
Deprecated logic for a while
urwid/canvas.py
Outdated
@@ -560,7 +562,7 @@ class BlankCanvas(Canvas): | |||
""" | |||
|
|||
def __init__(self) -> None: | |||
super().__init__(None) |
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.
Incorrect call (all arguments for the Canvas
class are deprecated)
urwid/display/_raw_display_base.py
Outdated
@@ -531,6 +531,40 @@ def _setup_G1(self) -> None: | |||
def draw_screen(self, size: tuple[int, int], r: Canvas) -> None: | |||
"""Paint screen with rendered canvas.""" | |||
|
|||
def set_cursor_home() -> str: |
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.
Moved to the top of method
o = [escape.HIDE_CURSOR, self._attrspec_to_escape(AttrSpec("", ""))] | ||
last_attributes = None # Default = empty | ||
|
||
output = [escape.HIDE_CURSOR, attr_to_escape(last_attributes)] |
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.
attr_to_escape
with None
should set default attributes. It's enough for normal and incremental draw.
|
||
if not (IS_WINDOWS or IS_WSL) and (first or lastcs != cs): | ||
if encoding != "utf-8" and (first or last_charset_flag != cs): |
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.
In case of WSL and Windows, charger is always utf-8
. Windows is mentioned in the python stdin
/stdout
/stderr
documentation explicit, WSL is well known.
On the listed in the PR comment terminals this rules worked perfectly with non-ascii symbols to display.
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.
My experience is mostly in VT100/xterm type terminals rather than the Windows command.com environment, but I'll take a look.
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.
Windows part is good, "normal" modern terminals also good. But I'm not 100% sure about old terminals.
Reduced amount of escape sequences seriously reduces future work pain, but I do not want to break something.
In case of this PR fully OK, we can detach final encoding for render from Canvas
(final composition & screen-independent render).
4438e07
to
b152412
Compare
* In the case of UTF-8 terminal, charset manipulation sequences are not needed. * In the case of no style changes, not needed to set style again each line * We know the first attributes since we set it on init Validated: * Linux console * FreeBSD console * XTerm * RXVT * VTE-based terminals * Alacritty * JetBrains IDE console * WSL 2 * Windows 11 cmd & powershell
b152412
to
5a1d1df
Compare
Check on the all not pre-historic terminals passed, prehistoric terminals do not support UTF-8 and receive all escape sequences as before. |
Validated:
Checklist
master
orpython-dual-support
branchtox
successfully in local environment