From e42df73644c82c657323d47a299f06cf44fdac39 Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Tue, 15 Oct 2002 00:27:55 +0000
Subject: [PATCH] - Disable VSTOP keystroke.  Stops people accidentally locking
 up, nano (suggested by David Benbennick)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1302 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog | 2 ++
 nano.c    | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e4752e44..05ade526 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ CVS code -
 	- Added Meta-Y toggle to disable/enable color syntax highlighting
 	  completely.  This may eventually be per-buffer, but that's too
 	  complicated for a feature freeze.
+	- Disable VSTOP keystroke.  Stops people accidentally locking up
+	  nano (suggested by David Benbennick).
 
 GNU nano 1.1.11 - 10/01/2002
 - General:
diff --git a/nano.c b/nano.c
index 538099dd..88928e17 100644
--- a/nano.c
+++ b/nano.c
@@ -2642,6 +2642,9 @@ void signal_init(void)
 #ifdef _POSIX_VDISABLE
     tcgetattr(0, &term);
 
+    /* Ignore ^s, much to Chris' chagrin */
+    term.c_cc[VSTOP] = _POSIX_VDISABLE;
+
 #ifdef VDSUSP
     term.c_cc[VDSUSP] = _POSIX_VDISABLE;
 #endif /* VDSUSP */
@@ -3488,6 +3491,12 @@ int main(int argc, char *argv[])
 		break;
 	    }
 	}
+
+#ifdef _POSIX_VDISABLE
+	/* Don't even think about changing this string */
+	if (kbinput == 19)
+	    statusbar(_("XOFF ignored, mumble mumble."));
+#endif
 	/* If we're in raw mode or using Alt-Alt-x, we have to catch
 	   Control-S and Control-Q */
 	if (kbinput == 17 || kbinput == 19)
-- 
GitLab