You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression? Faulty behaviour in PyCharm debug mode - Line break required, character limit not respected #126
A simple decision = readchar.readchar() will not work in PyCharm's debug mode despite terminal emulation being active. Run mode works as expected. In debug mode, I can enter more than one character and also need to press Enter at the end. The resulting string contains all the characters and a line break.
I also noticed, and I am unsure if this is a separate issue, that I need to stop my script twice when readchar.readchar() is active, the first press of the stop button will send a character and only the second press will actually stop my script. I can open a separate issue if this is not related.
Package version is 4.2.1
Python version is 3.12
PyCharm version is 2025.2.1.1
In debug mode, I can enter more than one character and also need to press Enter at the end. The resulting string contains all the characters and a line break.
This sound like it stems from PyCharm caching your input until you press enter and only than sending the whole string. On why it returnes more than one character I am confused.
I also noticed, and I am unsure if this is a separate issue, that I need to stop my script twice
This depends on how PyCharm is trying to interrupt your programm. readchar is only responsible if PyCharm is sending a CTRL+C character (so a 0x03 byte). If PyCharm trys other methods, like sending SIGINT or similar, that's not related to readchars functionality directly
This depends on how PyCharm is trying to interrupt your programm. readchar is only responsible if PyCharm is sending a CTRL+C character (so a 0x03 byte). I PyCharm tryth other methods, like sending SIGINT or similar, that's not related to readchars functionality directly
I see. I think it sends SIGKILL, at least that's what it reports when it succeeds. Might also be SIGTERM before or something like that. I will investigate.
I just tested on windows and can confirm that PyCharm is doing some wird stuff when starting a python programm. But it works as expected when using the integrated terminal and manually starting python tests/manual-tests.py, so its seems to be a issue with the IDE, not readchar...
Activity
Cube707 commentedon Sep 5, 2025
What OS are you using?
This sound like it stems from PyCharm caching your input until you press enter and only than sending the whole string. On why it returnes more than one character I am confused.
This depends on how PyCharm is trying to interrupt your programm.
readcharis only responsible if PyCharm is sending aCTRL+Ccharacter (so a0x03byte). If PyCharm trys other methods, like sendingSIGINTor similar, that's not related to readchars functionality directlyWildRikku commentedon Sep 5, 2025
SteamOS, so PyCharm is installed as a Flatpak.
I see. I think it sends SIGKILL, at least that's what it reports when it succeeds. Might also be SIGTERM before or something like that. I will investigate.
Cube707 commentedon Sep 5, 2025
OK, so linux based
I just tested on windows and can confirm that PyCharm is doing some wird stuff when starting a python programm. But it works as expected when using the integrated terminal and manually starting
python tests/manual-tests.py, so its seems to be a issue with the IDE, not readchar...