From fa0b59e966750e6d264edb445598e978ff57a7fa Mon Sep 17 00:00:00 2001 From: Mizev Andrew <150728785+carpalsgrabby@users.noreply.github.com> Date: Tue, 25 Nov 2025 09:58:10 +0100 Subject: [PATCH] Handle KeyboardInterrupt gracefully Avoid stack traces on Ctrl+C. --- choose_best_layout.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/choose_best_layout.py b/choose_best_layout.py index 8ac4dc2..ca47e96 100644 --- a/choose_best_layout.py +++ b/choose_best_layout.py @@ -165,4 +165,9 @@ def main() -> None: if __name__ == "__main__": - main() + try: + main() + except KeyboardInterrupt: + print("\nInterrupted by user.", file=sys.stderr) + sys.exit(130) +