Skip to content

Fix WSL support: filter-out SI/SO in case of WSL - #656

Merged
penguinolog merged 1 commit into
urwid:masterfrom
penguinolog:wsl_fix
Dec 5, 2023
Merged

Fix WSL support: filter-out SI/SO in case of WSL#656
penguinolog merged 1 commit into
urwid:masterfrom
penguinolog:wsl_fix

Conversation

@penguinolog

Copy link
Copy Markdown
Collaborator
Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

Fix: #264

@penguinolog penguinolog added bug Windows Windows support labels Oct 2, 2023
@penguinolog
penguinolog requested review from ulidtko and wardi October 2, 2023 12:07
@coveralls

coveralls commented Oct 2, 2023

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 7015530099

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 74.15%

Changes Missing Coverage Covered Lines Changed/Added Lines %
urwid/raw_display.py 2 4 50.0%
Files with Coverage Reduction New Missed Lines %
urwid/raw_display.py 1 18.19%
Totals Coverage Status
Change from base Build 7015514000: -0.01%
Covered Lines: 7519
Relevant Lines: 10284

💛 - Coveralls

@wardi

wardi commented Oct 2, 2023

Copy link
Copy Markdown
Collaborator

IIRC SO/SI are used for some graphics characters when not in UTF-8 mode:
https://github.com/urwid/urwid/blob/671ba131114cf86e79ebf76cd10d01c553e6054a/urwid/escape.py#L47C1-L47C55

instead of stripping these control characters at the last minute it's probably better to disable all the graphics character handling before sending it to the screen (graphics all get converted to ? or some other placeholder on WSL)

@penguinolog

penguinolog commented Nov 27, 2023

Copy link
Copy Markdown
Collaborator Author

IIRC SO/SI are used for some graphics characters when not in UTF-8 mode:
https://github.com/urwid/urwid/blob/671ba131114cf86e79ebf76cd10d01c553e6054a/urwid/escape.py#L47C1-L47C55

instead of stripping these control characters at the last minute it's probably better to disable all the graphics character handling before sending it to the screen (graphics all get converted to ? or some other placeholder on WSL)

WSL is in UTF8. I validated on real windows.
All characters displayed correctly (added also Cyrillic raw as sample):

image_2023-11-27_10-52-37.png

@penguinolog

Copy link
Copy Markdown
Collaborator Author

rebased from latest master

@penguinolog

Copy link
Copy Markdown
Collaborator Author

Validated that changes are not needed for curses display under WSL

@penguinolog
penguinolog merged commit 09f6c3b into urwid:master Dec 5, 2023
@penguinolog
penguinolog deleted the wsl_fix branch December 5, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Windows Windows support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

urwid WSL alignment and symbols

3 participants