From 33da4e5bd88b8729ec2f841c234c7577da6d092d Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Fri, 15 Oct 2004 09:03:07 +0000 Subject: [PATCH] Make pty's always come up in echo mode. --- sys/kern/tty.c | 2 +- sys/kern/tty_pty.c | 2 +- sys/sys/ttydefaults.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index f81b75aa3798..020529cff1af 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -3374,7 +3374,7 @@ ttyconsolemode(struct tty *tp, int speed) tp->t_init_in.c_iflag = TTYDEF_IFLAG; tp->t_init_in.c_oflag = TTYDEF_OFLAG; tp->t_init_in.c_cflag = TTYDEF_CFLAG | CLOCAL; - tp->t_init_in.c_lflag = TTYDEF_LFLAG | ECHO | ECHOE | ECHOKE | ECHOCTL; + tp->t_init_in.c_lflag = TTYDEF_LFLAG_ECHO; tp->t_lock_out.c_cflag = tp->t_lock_in.c_cflag = CLOCAL; if (speed == 0) speed = TTYDEF_SPEED; diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index e70cc98b8790..65645815cd86 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -178,7 +178,7 @@ ptsopen(struct cdev *dev, int flag, int devtype, struct thread *td) ttychars(tp); /* Set up default chars */ tp->t_iflag = TTYDEF_IFLAG; tp->t_oflag = TTYDEF_OFLAG; - tp->t_lflag = TTYDEF_LFLAG; + tp->t_lflag = TTYDEF_LFLAG_ECHO; tp->t_cflag = TTYDEF_CFLAG; tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; } else if (tp->t_state & TS_XCLUDE && suser(td)) diff --git a/sys/sys/ttydefaults.h b/sys/sys/ttydefaults.h index dd8bff2b417a..bd610b9ace1c 100644 --- a/sys/sys/ttydefaults.h +++ b/sys/sys/ttydefaults.h @@ -47,6 +47,7 @@ #define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) #define TTYDEF_OFLAG (OPOST | ONLCR) #define TTYDEF_LFLAG (ICANON | ISIG | IEXTEN) +#define TTYDEF_LFLAG_ECHO (TTYDEF_LFLAG | ECHO | ECHOE | ECHOKE | ECHOCTL) #define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) #define TTYDEF_SPEED (B9600)