Commit c3f16b5
Handle KeyboardInterrupt quietly, fix signal return codes
This is a continuation of #8.
The previous patch handled BrokenPipeError, this one makes it so that
KeyboardInterrupt is also handled. This is relevant when pressing ^C on
very large outputs (e.g. big files with --rows 999999). If such use of
^C occurs while in a pager, broken pipe errors were also printed by the
Python exit error handler.
This patch makes it so that both BrokenPipeError and KeyboardInterrupt
exit quietly.
As a drive-by fix, I realized that the exit codes were not following
the convention typically used e.g. by shells. The new code follows such
convention.1 parent a999908 commit c3f16b5
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
275 | 283 | | |
276 | 284 | | |
277 | 285 | | |
| |||
0 commit comments