Skip to content
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

debugger: leave output screen with single key press #674

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gsigh
Copy link

@gsigh gsigh commented Jan 18, 2025

This is a cleaned up submission of the PR 673 essence. Implements transparent support for platform dependent single key press without a prompt, with Python core and without external dependencies. Supports all major desktop systems where you expect to run the debugger, falls back to the most portable backwards compatible behaviour on platforms that are known to not work with the single key approach. Does not involve config items, needs no documentation update. The implementation is considered both readable and maintainable, supporting more platforms is straight forward as they get identified. Thank you for the feedback which helped very much in getting to that state.

Introduce support code for non-buffered console input (single key press
that doesn't accumulate input until ENTER is pressed). Support Windows
(msvcrt) and POSIX supporting Unix platforms (select and termios). Fall
back to the Python's input() routine for Webassembly and Emscripten.

Avoid the accumulation of repeated prompts on platforms that support
single key presses. Only the backwards compatible fallback on minor
platforms involves a prompt, so users can tell when they face that
situation.

The approach in this commit automatically detects platforms, no config
option is required. All depencencies are provided by Python core, there
are no external dependencies. The implementation is considered suitable
for future maintenance, extension, or adjustment for other platforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant