]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
define env NEWT_NOFLOWCTRL to disable flow control
authorRobert Gill <locke@sdf.lonestar.org>
Sun, 22 Jul 2018 04:09:40 +0000 (04:09 +0000)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 23 Jul 2018 07:11:28 +0000 (09:11 +0200)
Define the environment variable NEWT_NOFLOWCTRL to disable software flow
control similarly to how the command 'stty -ixon' disables flow control
when using ncurses.

newt.c

diff --git a/newt.c b/newt.c
index 1a913a0977b71493aef5233c7c28ffeeb0c96d23..0a6ca914a9dc059180e5496c42fdf0a7dfc41271 100644 (file)
--- a/newt.c
+++ b/newt.c
@@ -38,6 +38,7 @@ static char ** currentHelpline = NULL;
 
 static int cursorRow, cursorCol;
 static int cursorOn = 1;
+static int noFlowCtrl = 0;
 static int trashScreen = 0;
 extern int needResize;
 
@@ -355,7 +356,7 @@ void newtSuspend(void) {
 int newtResume(void) {
     SLsmg_resume_smg ();
     SLsmg_refresh();
-    return SLang_init_tty(0, 0, 0);
+    return SLang_init_tty(0, noFlowCtrl, 0);
 }
 
 void newtCls(void) {
@@ -386,6 +387,7 @@ void newtResizeScreen(int redraw) {
  */
 int newtInit(void) {
     char * MonoValue, * MonoEnv = "NEWT_MONO";
+    char * NoFlowCtrlValue, * NoFlowCtrlEnv = "NEWT_NOFLOWCTRL";
     const char *lang;
     int ret;
 
@@ -408,9 +410,13 @@ int newtInit(void) {
     if ( MonoValue != NULL )
        SLtt_Use_Ansi_Colors = 0;
 
+    NoFlowCtrlValue = getenv(NoFlowCtrlEnv);
+    if ( NoFlowCtrlValue != NULL )
+        noFlowCtrl = 1;
+
     if ((ret = SLsmg_init_smg()) < 0)
        return ret;
-    if ((ret = SLang_init_tty(0, 0, 0)) < 0)
+    if ((ret = SLang_init_tty(0, noFlowCtrl, 0)) < 0)
        return ret;
 
     initColors();