Add missing file /.profile.

Simplify stty utility, remove unused options.
This commit is contained in:
Serge Vakulenko
2015-09-13 01:59:42 -07:00
parent 967ec35fd2
commit 0087168ba6
6 changed files with 31 additions and 95 deletions

3
.gitignore vendored
View File

@@ -24,8 +24,5 @@
*.dis
*.0
*.img
sdcard.rd
.profile
*~
Makefile.user

7
.profile Normal file
View File

@@ -0,0 +1,7 @@
echo 'erase ^?, kill ^U, intr ^C'
stty dec
PATH=/bin:/sbin:/etc
export PATH
HOME=/
export HOME
export TERM

View File

@@ -59,32 +59,32 @@ first rows and then columns.
.PP
\fIOperands\fP are selected from the following:
.TP 10
.B even
.B even
allow even parity input
.br
.ns
.TP 10
.B \-even
.B \-even
disallow even parity input
.TP 10
.B odd
.B odd
allow odd parity input
.br
.ns
.TP 10
.B \-odd
.B \-odd
disallow odd parity input
.TP 10
.B raw
.B raw
raw mode input
(\fBno\fR input processing (erase, kill, interrupt, ...); parity bit passed back)
.br
.ns
.TP 10
.B \-raw
.B \-raw
negate raw mode
.TP 10
.B cooked
.B cooked
same as `\-raw'
.TP 10
.B cbreak
@@ -96,29 +96,29 @@ but all other processing (interrupt, suspend, ...) is performed
.ns
.TP 10
.B \-cbreak
make characters available to
make characters available to
.I read
only when newline is received
.TP 10
.B \-nl
.B \-nl
allow carriage return for new-line,
and output CR-LF for carriage return or new-line
.br
.ns
.TP 10
.B nl
.B nl
accept only new-line to end lines
.TP 10
.B echo
.B echo
echo back every character typed
.br
.ns
.TP 10
.B \-echo
.B \-echo
do not echo characters
.TP 10
.B tandem
enable inbound software (xon/xoff) flow control, so that the system sends
enable inbound software (xon/xoff) flow control, so that the system sends
out the stop character when
its internal queue is in danger of overflowing on input, and sends the
start character when it is ready to accept further input
@@ -128,12 +128,12 @@ start character when it is ready to accept further input
.B \-tandem
disable inbound software (xon/xoff) flow control
.TP 10
.B \-tabs
.B \-tabs
replace tabs by spaces when printing
.br
.ns
.TP 10
.B tabs
.B tabs
preserve tabs
.br
.PP
@@ -201,11 +201,10 @@ This character is an additional character causing wakeup.
.TP 10
.B dec
set all modes suitable for Digital Equipment Corp. operating systems
users; (erase, kill, and interrupt characters to ^?, ^U, and ^C,
decctlq and ``newcrt''.)
users; (erase, kill, and interrupt characters to ^?, ^U, and ^C, and ``crt''.)
.ns
.TP 10
.B 0
.B 0
hang up phone line immediately
.br
.ns
@@ -235,11 +234,6 @@ and more functionality than the basic driver is fully described in
.IR tty (4).
The following options apply only to it.
.TP 10
.B new
Use new driver (switching flushes typeahead).
.br
.ns
.TP 10
.B crt
Set options for a CRT (crtbs, ctlecho and, if >= 1200 baud,
crterase and crtkill.)
@@ -276,18 +270,6 @@ Print two backspaces following the EOT character (control D).
Control characters echo as themselves; in cooked mode EOT (control-D)
is not echoed.
.TP 10
.B decctlq
After output is suspended (normally by ^S), only a start character
(normally ^Q) will restart it. This is compatible with DEC's vendor
supplied systems.
.br
.ns
.TP 10
.B \-decctlq
After output is suspended, any character typed will restart it;
the start character will restart output without providing any input.
(This is the default.)
.TP 10
.B tostop
Background jobs stop if they attempt terminal output.
.br
@@ -305,7 +287,7 @@ Output is being discarded usually because user hit control O (internal state bit
Output is not being discarded.
.TP 10
.B pendin
Input is pending after a switch from cbreak to cooked
Input is pending after a switch from cbreak to cooked
and will be re-input when a read becomes pending or more input arrives
(internal state bit).
.br
@@ -346,9 +328,7 @@ Don't send hangup signal if carrier drops.
.B \-nohang
Send hangup signal to control process group when carrier drops.
.PP
The following special characters are applicable only to the new
teletype driver
and are not normally changed.
The following special characters are not normally changed.
.TP 10
.BI susp \ c\fR
set suspend process character to \fIc\fR (default control Z).

View File

@@ -106,8 +106,6 @@ struct MODES lmodes[] = {
"-ctlecho", 0, LCTLECH,
"pendin", LPENDIN, 0,
"-pendin", 0, LPENDIN,
"decctlq", LDECCTQ, 0,
"-decctlq", 0, LDECCTQ,
"noflsh", LNOFLSH, 0,
"-noflsh", 0, LNOFLSH,
0
@@ -223,33 +221,9 @@ args:
while (argc-- > 0) {
arg = *argv++;
if (eq("new")){
ldisc = NTTYDISC;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue;
}
if (eq("newcrt")){
ldisc = NTTYDISC;
lmode &= ~LPRTERA;
lmode |= LCRTBS|LCTLECH;
if (mode.sg_ospeed >= B1200)
lmode |= LCRTERA|LCRTKIL;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue;
}
if (eq("crt")){
lmode &= ~LPRTERA;
lmode |= LCRTBS|LCTLECH;
if (mode.sg_ospeed >= B1200)
lmode |= LCRTERA|LCRTKIL;
continue;
}
if (eq("old")){
ldisc = 0;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
crt: lmode &= ~LPRTERA;
lmode |= LCRTBS | LCTLECH | LCRTERA | LCRTKIL;
continue;
}
if (eq("sane")){
@@ -261,14 +235,7 @@ args:
mode.sg_erase = 0177;
mode.sg_kill = CTRL('u');
tc.t_intrc = CTRL('c');
ldisc = NTTYDISC;
lmode &= ~LPRTERA;
lmode |= LCRTBS|LCTLECH|LDECCTQ;
if (mode.sg_ospeed >= B1200)
lmode |= LCRTERA|LCRTKIL;
if (ioctl(1, TIOCSETD, &ldisc)<0)
perror("ioctl");
continue;
goto crt;
}
for (sp = special; sp->name; sp++)
if (eq(sp->name)) {
@@ -387,11 +354,7 @@ prmodes(all)
fprintf(stderr, "net discipline, ");
else
#endif
if (ldisc==NTTYDISC)
fprintf(stderr, "new tty, ");
else if (ldisc == 0)
fprintf(stderr, "old tty, ");
else
if (ldisc!=NTTYDISC)
fprintf(stderr, "discipline %d, ");
if(mode.sg_ispeed != mode.sg_ospeed) {
@@ -435,8 +398,7 @@ prmodes(all)
}
if (ldisc == NTTYDISC) {
int newcrt = (lmode & (LCTLECH|LCRTBS)) == (LCTLECH|LCRTBS) &&
(lmode & (LCRTERA|LCRTKIL)) ==
((mode.sg_ospeed > B300) ? LCRTERA|LCRTKIL : 0);
(lmode & (LCRTERA|LCRTKIL)) == (LCRTERA|LCRTKIL);
int nothing = 1;
if (newcrt) {
if (all)
@@ -468,7 +430,6 @@ prmodes(all)
nothing = 0;
}
lpit(LPENDIN, "-pendin ");
lpit(LDECCTQ, "-decctlq ");
lpit(LNOFLSH, "-noflsh ");
if (any || nothing)
fputc('\n', stderr);

View File

@@ -161,7 +161,6 @@ struct ttysize {
#define PASS8 0x08000000
#define CTLECH 0x10000000 /* echo control chars as ^X */
#define PENDIN 0x20000000 /* tp->t_rawq needs reread */
#define DECCTQ 0x40000000 /* only ^Q starts after ^S */
#define NOFLSH 0x80000000 /* no output flush on signal */
/* locals, from 127 down */
#define TIOCLBIS _IOW('t', 127, int) /* bis local mode bits */
@@ -181,7 +180,6 @@ struct ttysize {
#define LPASS8 ((int)(PASS8>>16))
#define LCTLECH ((int)(CTLECH>>16))
#define LPENDIN ((int)(PENDIN>>16))
#define LDECCTQ ((int)(DECCTQ>>16))
#define LNOFLSH ((int)(NOFLSH>>16))
#define TIOCSBRK _IO ('t', 123) /* set break bit */
#define TIOCCBRK _IO ('t', 122) /* clear break bit */

View File

@@ -1225,13 +1225,6 @@ erasenb:
}
}
endcase:
/*
* If DEC-style start/stop is enabled don't restart
* output until seeing the start character.
*/
if (t_flags & DECCTQ && tp->t_state & TS_TTSTOP &&
tp->t_startc != tp->t_stopc)
return;
restartoutput:
tp->t_state &= ~TS_TTSTOP;
tp->t_flags &= ~FLUSHO;