Uh oh!
There was an error while loading. Please reload this page.
gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL - #120354
Conversation
pablogsal
commented
Jun 11, 2024
@lysnikolaou Unfortunately I have not found a proper way to test this since it requires a terminal that sends something on Ctrl-C (sending signals won't test that we are not intercepting ourselves Ctrl-C neither will do it writing manually Ctrl-C to the REPL because that will never arrive if this is done properly), so this needs to be manually tested. Do you mind confirming that it works on your side? |
pablogsal
commented
Jun 11, 2024
Check #120221 (comment) for a reproducer |
Uh oh!
There was an error while loading. Please reload this page.
…e-120221.si9hM9.rst Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
lysnikolaou
commented
Jun 11, 2024
This works for me! Only weird thing is that it adds some kind of weird indentation when pressing Ctrl-C more times. ❯ ./python.exePython3.14.0a0 (heads/paste:4e170a4361b, Jun112024, 19:04:57) [Clang15.0.0 (clang-1500.3.9.4)] ondarwinType"help", "copyright", "credits"or"license"formoreinformation.
>>>importsignal>>>signal.signal(signal.SIGINT,\040lambda\040*x:\040print("NOOOO"))KeyboardInterrupt>>>signal.signal(signal.SIGINT, lambda*x: print("NOOOO"))
<built-infunctiondefault_int_handler>>>>NOOOONOOOONOOOONOOOONOOOONOOOO |
Yeah, but I think is because it's printing in the middle of REPL code and not informing the reader (that's expected). |
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
… REPL (pythonGH-120354) (cherry picked from commit 34e4d32) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
GH-120368 is a backport of this pull request to the 3.13 branch. |
Uh oh!
There was an error while loading. Please reload this page.