From d1011b6e03d1bb39cd828e2ade03fe8d2ff3f062 Mon Sep 17 00:00:00 2001 From: Robert Gill Date: Jul 22 2018 04:09:40 +0000 Subject: define env NEWT_NOFLOWCTRL to disable flow control Define the environment variable NEWT_NOFLOWCTRL to disable software flow control similarly to how the command 'stty -ixon' disables flow control when using ncurses. --- diff --git a/newt.c b/newt.c index 1a913a0..0a6ca91 100644 --- 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();