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 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user