Merge pull request #2409 from MycroftAI/bugfix/ctrlc-simple-cli
Restore Ctrl+C exit of simple CLIpull/2411/head
commit
7fa3fca006
|
@ -13,13 +13,15 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
import sys
|
||||
import signal
|
||||
import io
|
||||
import os.path
|
||||
import curses
|
||||
from mycroft.util import get_ipc_directory
|
||||
from .text_client import (
|
||||
load_settings, save_settings, simple_cli, gui_main,
|
||||
start_log_monitor, start_mic_monitor, connect_to_mycroft
|
||||
start_log_monitor, start_mic_monitor, connect_to_mycroft,
|
||||
ctrl_c_handler
|
||||
)
|
||||
from mycroft.configuration import Configuration
|
||||
|
||||
|
@ -57,6 +59,8 @@ def main():
|
|||
sys.stderr = sys.__stderr__
|
||||
simple_cli()
|
||||
else:
|
||||
# Special signal handler allows a clean shutdown of the GUI
|
||||
signal.signal(signal.SIGINT, ctrl_c_handler)
|
||||
load_settings()
|
||||
curses.wrapper(gui_main)
|
||||
curses.endwin()
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#
|
||||
import sys
|
||||
import io
|
||||
import signal
|
||||
from math import ceil
|
||||
|
||||
from .gui_server import start_qml_gui
|
||||
|
@ -121,9 +120,6 @@ def ctrl_c_pressed():
|
|||
return False
|
||||
|
||||
|
||||
signal.signal(signal.SIGINT, ctrl_c_handler)
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Helper functions
|
||||
|
||||
|
|
Loading…
Reference in New Issue