GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-111201: Support pyrepl on Windows by DinoV · Pull Request #119559 · python/cpython Conversation
|
| info = CONSOLE_SCREEN_BUFFER_INFO() | ||
| if not GetConsoleScreenBufferInfo(OutHandle, info): | ||
| raise WinError(GetLastError()) | ||
| return info.dwCursorPosition.X, info.dwCursorPosition.Y |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
📝: This is relative to the origin of the buffer, not of the viewport. is this supposed to be viewport relative in the unix version?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
|
||
| return Event(evt="key", data=key, raw=rec.Event.KeyEvent.uChar.UnicodeChar) | ||
|
|
||
| def push_char(self, char: int | bytes) -> None: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suppose I don't totally understand how this is supposed to be used, but there is WriteConsoleInput which sounds similar
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is specifically about push_char? I don't think it's actually used but it does seem to technically be public API surface. The unix version calls this on inputted chars.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| self.__posxy = 0, 0 | ||
| self.__gone_tall = 0 | ||
| self.__offset = 0 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
📝: the unix version also:
smkx (\x1b[?1h)I'm pretty sure the console supported ?1h back to RS1, and bracketed paste as of microsoft/terminal#15155 (not sure exactly where in Windows 11 that gets enabled)
You're probably fine continuing to not do them here, but they could maybe get added later.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
fwiw, this REPL is only activated on builds >= 10586
https://github.com/python/cpython/pull/119559/files#diff-45ae56fc192319dbdbe6aca3aa4c7abd31a4a5a38b775805249ba765c9476976R8
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for your notes @zadjii-msft! One problem we are still having I think is that resizing the terminal when there are wide Unicode characters such as emojis in many lines doesn't work (the characters don't get resposition after a resize makes the lines warp around and back to normal). This looks like it's a windows only problem because the unix terminal handles that correctly. I think @ambv or @DinoV may be able to provide more information. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Unicode input and emojis work now. Amazing progress! I'm landing this, we can add further improvements like bracketed paste in future updates. Thanks, @DinoV! ✨ 🍰 ✨ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Buildbot failure related. Fixing now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit 0d07182) Co-authored-by: Dino Viehland <[email protected]> Co-authored-by: Anthony Shaw <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit 0d07182) Co-authored-by: Dino Viehland <[email protected]> Co-authored-by: Anthony Shaw <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
|
GH-119850 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Oh that for sure sounds like a us bug. We've been making pretty dramatic improvements to the unicode / emoji support over the last couple years, so I'm guessing you're seeing different behavior even depending on what version of Windows & the Terminal you're running. If you've got specific bugs on your tracker for those, point me at 'em, and I can get the team to double check them EDIT: derp I only read one mail, then replied to it before I saw #119559 (comment). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if sys.platform != "win32": | ||
| CAN_USE_PYREPL = True | ||
| else: | ||
| CAN_USE_PYREPL = sys.getwindowsversion().build >= 10586 # Windows 10 TH2 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This merged as-is which is OK, but I wanted to chip in...
There is a minimal risk of cutting out terminals that would support pyrepl on earlier versions of Windows. The "most correct" (also most soapboxy, sorry!) way to determine support for this is to just try to set ENABLE_VIRTUAL_TERMINAL_PROCESSING and only fall back to basic console APIs if it fails. :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@DHowett sounds like an improvement we can still make! Care to PR this?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I can try - at the very least, it would be a great opportunity for me to learn how to build and deploy Python 🙂
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@DHowett see here and let me know if anything's missing:
https://devguide.python.org/getting-started/setup-building/#windows
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit 0d07182) Co-authored-by: Dino Viehland <[email protected]> Co-authored-by: Anthony Shaw <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
Co-authored-by: Anthony Shaw <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.