diff --git a/fastanime/cli/__init__.py b/fastanime/cli/__init__.py index 3f23768..c20f999 100644 --- a/fastanime/cli/__init__.py +++ b/fastanime/cli/__init__.py @@ -1,3 +1,5 @@ +import signal + import click from .. import __version__ @@ -17,6 +19,19 @@ } +# handle keyboard interupt +def handle_exit(signum, frame): + from .utils.tools import exit_app + from .utils.utils import clear + + clear() + + exit_app() + + +signal.signal(signal.SIGINT, handle_exit) + + @click.group( commands=commands, help="A command line application for streaming anime that provides a complete and featureful interface",