From cace36f1224ef930d6a631eb1e1e55f180b7cf7a Mon Sep 17 00:00:00 2001 From: jon Date: Wed, 22 Jul 2026 15:30:07 -0500 Subject: [PATCH] fix(ncp): exit quietly on Ctrl+C instead of dumping a traceback Ctrl+C is how you quit 'ncp web', which blocks on the UI window. It printed a six-frame traceback ending in WaitForSingleObject, reading as a crash. Exits 130 instead. Co-Authored-By: Claude Opus 4.8 --- management/ncp.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/management/ncp.py b/management/ncp.py index 4b5f276..07d60fe 100644 --- a/management/ncp.py +++ b/management/ncp.py @@ -727,4 +727,12 @@ def main(argv) -> int: if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) + try: + sys.exit(main(sys.argv[1:])) + except KeyboardInterrupt: + # Ctrl+C is how you quit `ncp web` - it waits on the UI window. Without + # this it printed a six-frame traceback ending in WaitForSingleObject, + # which reads as a crash rather than "you pressed Ctrl+C". 130 is the + # conventional exit status for SIGINT. + print() + sys.exit(130)