stty should take the -l flag as a no-op, so "stty -all" works. Fix: opterr = 0; while (optind < argc && - strspn(argv[optind], "-aefg") == strlen(argv[optind]) && - (ch = getopt(argc, argv, "aef:g")) != -1) + strspn(argv[optind], "-aefgl") == strlen(argv[optind]) && + (ch = getopt(argc, argv, "aef:gl")) != -1) switch(ch) { case 'a': /* undocumented: POSIX compatibility */ fmt = POSIX; @@ -91,6 +91,8 @@ case 'g': fmt = GFLAG; break; + case 'l': + break; case '?': default: goto args;--A9XbO6c0akrztTeyY26VcLzwWXE7mLaiQT4NhnambXsELTrf Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- stty.1.orig Sun Feb 2 12:52:54 2003 +++ stty.1 Sun Feb 2 12:54:56 2003 @@ -43,7 +43,7 @@ .Nd set the options for a terminal device interface .Sh SYNOPSIS .Nm -.Op Fl a | Fl e | Fl g +.Op Fl a | Fl e | Fl g | Fl l .Op Fl f Ar file .Op operands .Sh DESCRIPTION @@ -84,6 +84,8 @@ .It Fl g Display all the current settings for the terminal to standard output in a form that may be used as an argument to a subsequent invocation of +.It Fl l +No-op for backwards compatibility ("stty -all"). .Nm to restore the current terminal state as per .St -p1003.2 . --- stty.c.orig Sun Feb 2 12:50:52 2003 +++ stty.c Sun Feb 2 12:51:50 2003 @@ -75,8 +75,8 @@ How-To-Repeat: 6-sec# stty -all stty: illegal option -- -all usage: stty [-a|-e|-g] [-f file] [options]
Move the man page change down 3 lines. Updated diff: --- stty.1.orig Sun Feb 2 12:52:54 2003 +++ stty.1 Sun Feb 2 13:05:32 2003 @@ -43,7 +43,7 @@ .Nd set the options for a terminal device interface .Sh SYNOPSIS .Nm -.Op Fl a | Fl e | Fl g +.Op Fl a | Fl e | Fl g | Fl l .Op Fl f Ar file .Op operands .Sh DESCRIPTION @@ -87,6 +87,8 @@ .Nm to restore the current terminal state as per .St -p1003.2 . +.It Fl l +No-op for backwards compatibility ("stty -all"). .El .Pp The following arguments are available to set the terminal
On Sun, Feb 02, 2003 at 01:13:54PM -0500, Charlie Root wrote: > > stty should take the -l flag as a no-op, so "stty -all" works. > Compatibility with who/what? Cheers, -- Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age
Ruslan Ermilov wrote: > On Sun, Feb 02, 2003 at 01:13:54PM -0500, Charlie Root wrote: >>stty should take the -l flag as a no-op, so "stty -all" works. > > Compatibility with who/what? Historical SysV and BSD/SysV hybrids, CMU's /usr/local version. Or my memory thereof. :-) Having "stty all" ~= "stty -all" ~= "stty -a" is convenient, and it even works on the box I'm mailing you from: $ stty -all speed 38400 baud; rows 25; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff-iuclc -ixany -imaxbelopost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0isig icanon iexten echo -echoe -echok -echonl -noflsh -tostop -echoctl -echoke $ uname -a CYGWIN_NT-5.1 prime 1.3.19(0.71/3/2) 2003-01-23 21:31 i686 unknown unknown Cygwin About 10% of the Google hits show that form, as well. -Chuck
Apart from the questionable use of this addition, it may also interfere with future stty operands starting with a '-'. For example, '-nl' is an operand. Adding both '-n' and '-l' options would break it. -- Jilles Tjoelker
As noted years ago, I don't think this will be added.