Skip to content

Commit

Permalink
[kernel][stty] Fix stty erase and sane
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Apr 5, 2020
1 parent 37b71e2 commit 9de9190
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions elks/arch/i86/drivers/char/ntty.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ void tty_echo(register struct tty *tty, unsigned char ch)
{
if ((tty->termios.c_lflag & ECHO)
|| ((tty->termios.c_lflag & ECHONL) && (ch == '\n'))) {
chq_addch(&tty->outq, ch);
if ((ch == '\b') && (tty->termios.c_lflag & ECHOE)) {
if ((ch == tty->termios.c_cc[VERASE]) && (tty->termios.c_lflag & ECHOE)) {
chq_addch(&tty->outq, '\b');
chq_addch(&tty->outq, ' ');
chq_addch(&tty->outq, '\b');
}
} else
chq_addch(&tty->outq, ch);
tty->ops->write(tty);
}
}
Expand Down
6 changes: 3 additions & 3 deletions elkscmd/sh_utils/stty.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct winsize winsize;
#define PROTO(a) ()
#endif

void main PROTO(( int argc, char **argv ));
int main PROTO(( int argc, char **argv ));
void report PROTO(( int flags ));
int option PROTO(( char *opt, char *next ));
int match PROTO(( char *s1, char *s2 ));
Expand All @@ -114,7 +114,7 @@ void set_min_tim PROTO(( int option, char *value ));
#define print_char(c,d,n,a) (do_print_char((unsigned)(c),(unsigned)(d),(n),(a)))
#define print_num(m,d,n,a) (do_print_num((unsigned)(m),(unsigned)(d),(n),(a)))

void main(argc, argv)
int main(argc, argv)
int argc;
char *argv[];
{
Expand Down Expand Up @@ -886,7 +886,7 @@ char *opt, *next;
*/
termios.c_iflag= (TINPUT_DEF & ~(IGNPAR|ISTRIP|INPCK))
| (termios.c_iflag & (IGNPAR|ISTRIP|INPCK));
termios.c_oflag= (TOUTPUT_DEF & ~(XTABS))
termios.c_oflag= (TOUTPUT_DEF & ~(XTABS)) | ONLCR
| (termios.c_oflag & (XTABS));
termios.c_cflag= (TCTRL_DEF & ~(CLOCAL|CSIZE|CSTOPB|PARENB|PARODD))
| (termios.c_cflag & (CLOCAL|CSIZE|CSTOPB|PARENB|PARODD));
Expand Down

0 comments on commit 9de9190

Please sign in to comment.