summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-03-24 13:22:23 -0400
committerDan Winship <danw@gnome.org>2014-03-24 13:22:23 -0400
commitce26445b6f720fb8261e18b7fbda08dfd153e5e3 (patch)
treee3039cd5d3e6b527c616cb97d1d9d3bd45e8353d
parentb4216ccb2df00936a45c6f765be5023257188989 (diff)
downloadNetworkManager-ce26445b6f720fb8261e18b7fbda08dfd153e5e3.tar.gz
tui: allow ^Z to suspend the app
This way if we end up with bugs that make it otherwise impossible to kill nmtui, you can at least ^Z and then kill it from the command line.
-rw-r--r--tui/newt/nmt-newt-utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tui/newt/nmt-newt-utils.c b/tui/newt/nmt-newt-utils.c
index 10e8484927..68d8c449e5 100644
--- a/tui/newt/nmt-newt-utils.c
+++ b/tui/newt/nmt-newt-utils.c
@@ -110,6 +110,14 @@ nmt_newt_basic_g_log_handler (const char *log_domain,
newtResume ();
}
+static void
+nmt_newt_suspend_callback (gpointer user_data)
+{
+ newtSuspend ();
+ kill (getpid (), SIGTSTP);
+ newtResume ();
+}
+
/**
* nmt_newt_init:
*
@@ -132,6 +140,8 @@ nmt_newt_init (void)
g_log_set_default_handler (nmt_newt_dialog_g_log_handler, NULL);
else
g_log_set_default_handler (nmt_newt_basic_g_log_handler, NULL);
+
+ newtSetSuspendCallback (nmt_newt_suspend_callback, NULL);
}
/**