Skip to content

Commit f01f811

Browse files
committed
chore(present): inform about SIGINT
1 parent 94265f6 commit f01f811

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

manim_slides/present.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import platform
3+
import signal
34
import sys
45
import time
56
from enum import Enum, IntEnum, auto, unique
@@ -1102,4 +1103,16 @@ def present(
11021103
start_at_animation_number=start_at_animation_number,
11031104
)
11041105
a.show()
1106+
1107+
# inform about CTRL+C
1108+
def sigkill_handler(signum, frame):
1109+
logger.warn(
1110+
"Thie application cannot be closed with usual CTRL+C, "
1111+
"please use the appropriate key defined in your config "
1112+
"(default: q)."
1113+
)
1114+
1115+
raise KeyboardInterrupt
1116+
1117+
signal.signal(signal.SIGINT, sigkill_handler)
11051118
sys.exit(app.exec_())

0 commit comments

Comments
 (0)