Commit 8d89bf4
committed
Only allow KeyboardInterrupt at specific times
Because our goal is to proxy interrupt signals to the remote process,
it's important that we only accept those signals at moments when we're
ready to handle them and send them on. In particular, we're prepared to
handle them when reading user input for a prompt, and when waiting for
the server to send a new prompt after our last command. We do not want
to accept them at other times, like while we're in the middle of
printing output to the screen, as otherwise a
while True: "Hello"
executed at the PDB REPL can't reliably be Ctrl-C'd: it's more likely
that the signal will arrive while the client is printing than while it's
waiting for the next line from the server, and if so nothing will be
prepared to handle the `KeyboardInterrupt` and the client will exit.1 parent 0e21ed7 commit 8d89bf4
1 file changed
Lines changed: 48 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3009 | 3009 | | |
3010 | 3010 | | |
3011 | 3011 | | |
| 3012 | + | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
3012 | 3049 | | |
3013 | | - | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
3014 | 3054 | | |
3015 | 3055 | | |
3016 | | - | |
3017 | | - | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
3018 | 3059 | | |
3019 | 3060 | | |
3020 | 3061 | | |
| |||
3061 | 3102 | | |
3062 | 3103 | | |
3063 | 3104 | | |
3064 | | - | |
| 3105 | + | |
| 3106 | + | |
3065 | 3107 | | |
3066 | 3108 | | |
3067 | 3109 | | |
| |||
3101 | 3143 | | |
3102 | 3144 | | |
3103 | 3145 | | |
3104 | | - | |
| 3146 | + | |
| 3147 | + | |
3105 | 3148 | | |
3106 | 3149 | | |
3107 | 3150 | | |
| |||
0 commit comments