Repository navigation
RAW UTF-8 terminal: SI/SO/IBMPC_ON/IBMPC_OFF skip - #787
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. |
| def mode_rb(text: str, colors: int, state: bool = False) -> urwid.AttrMap: | ||
| # 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.
Deprecated logic for a while
| """ | ||
|
|
||
| def __init__(self) -> None: | ||
| super().__init__(None) |
There was a problem hiding this comment.
Incorrect call (all arguments for the Canvas class are deprecated)
| 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.
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.
attr_to_escape with None should set default attributes. It's enough for normal and incremental draw.
| last_attributes = a | ||
|
|
||
| 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.
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.
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.
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
masterorpython-dual-supportbranchtoxsuccessfully in local environment