Skip to content

Commit d4a91ca

Browse files
committed
feat: keyboard interrupt
1 parent 6e4914c commit d4a91ca

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

autohack/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ def entrypoint():
3636

3737
# 使用 8位 短随机字符代替过长的 UUID,防止冗长同时保证多个实例独立
3838
app = AppCentral(secrets.token_hex(4), time.localtime(), debug=args.debug)
39-
app.run()
39+
40+
try:
41+
app.run()
42+
except KeyboardInterrupt:
43+
import sys
44+
45+
sys.stdout.write("\nKeyboard interrupt received. Exiting...\n")
4046

4147
# TODO: Keyboard interrupt handling

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)