]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
stty: document the 'discard' character setting
authorPádraig Brady <P@draigBrady.com>
Fri, 23 Jan 2015 00:43:58 +0000 (00:43 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 24 Jan 2015 01:06:59 +0000 (01:06 +0000)
The equivalent of this is 'flush', but that was never documented
as an option (though was output with stty -a).  Therefore use
the more descriptive name, also generally used on BSD systems.
Note even though this setting seems ineffective on Linux, supporting
the setting is useful to allow terminal programs to receive
the default ^O character code.

* doc/coreutils.texi (stty invocation): Document the 'discard' option.
* src/stty.c (struct control_info): Add 'discard'; same as 'flush'.
(display_all): Show 'discard' rather than 'flush' char.
(display_changed): Likewise.
(usage): Document the 'discard' option.

doc/coreutils.texi
src/stty.c

index f840940394f316c78d87c4d81367640e7e6961cb..078bca3404ed8302cf1fb57ca4a6a9448de64a5d 100644 (file)
@@ -14438,6 +14438,11 @@ End the line.
 @opindex eol2
 Alternate character to end the line.  Non-POSIX.
 
+@item discard
+@opindex discard
+@opindex flush
+Alternate character to toggle discarding of output.  Non-POSIX.
+
 @item swtch
 @opindex swtch
 Switch to a different shell layer.  Non-POSIX.
index bac2839cc4acd35dee9d7a741e959e277a303f98..f3fb714b3ea43b5f716937567a5f4bc2e0c8ea04 100644 (file)
@@ -417,7 +417,8 @@ static struct control_info const control_info[] =
   {"lnext", CLNEXT, VLNEXT},
 #endif
 #ifdef VFLUSHO
-  {"flush", CFLUSHO, VFLUSHO},
+  {"flush", CFLUSHO, VFLUSHO},   /* deprecated compat option.  */
+  {"discard", CFLUSHO, VFLUSHO},
 #endif
 #ifdef VSTATUS
   {"status", CSTATUS, VSTATUS},
@@ -544,6 +545,11 @@ settings.  The underlying system defines which settings are available.\n\
       fputs (_("\
 \n\
 Special characters:\n"), stdout);
+#ifdef VFLUSHO
+      fputs (_("\
+ * discard CHAR  CHAR will toggle discarding of output\n\
+"), stdout);
+#endif
 #ifdef VDSUSP
       fputs (_("\
  * dsusp CHAR    CHAR will send a terminal stop signal once input flushed\n\
@@ -1697,6 +1703,12 @@ display_changed (struct termios *mode)
     {
       if (mode->c_cc[control_info[i].offset] == control_info[i].saneval)
         continue;
+
+#ifdef VFLUSHO
+      /* 'flush' is the deprecated equivalent of 'discard'.  */
+      if (STREQ (control_info[i].name, "flush"))
+        continue;
+#endif
       /* If swtch is the same as susp, don't print both.  */
 #if VSWTCH == VSUSP
       if (STREQ (control_info[i].name, "swtch"))
@@ -1787,6 +1799,11 @@ display_all (struct termios *mode, char const *device_name)
 
   for (i = 0; ! STREQ (control_info[i].name, "min"); ++i)
     {
+#ifdef VFLUSHO
+      /* 'flush' is the deprecated equivalent of 'discard'.  */
+      if (STREQ (control_info[i].name, "flush"))
+        continue;
+#endif
       /* If swtch is the same as susp, don't print both.  */
 #if VSWTCH == VSUSP
       if (STREQ (control_info[i].name, "swtch"))