bin/68552: tip(1) does not set noncanonical mode input processing properly

Li-Lun Wang (Leland Wang) llwang at
Thu Jul 1 04:50:51 PDT 2004

>Number:         68552
>Category:       bin
>Synopsis:       tip(1) does not set noncanonical mode input processing properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 01 11:50:19 GMT 2004
>Originator:     Li-Lun Wang (Leland Wang)
>Release:        FreeBSD 4.9-RELEASE-p1 i386
System: FreeBSD 4.9-RELEASE-p1 FreeBSD 4.9-RELEASE-p1 #1: Wed Dec 3 02:14:02 CST 2003 root at i386

tip(1) uses noncanonical mode input processing. However, it does not
set the values of the VMIN and VTIME members of the c_cc array properly
such that it fails to run within gnu screen started up detached. Running
tip within screen started detached makes getchar() in tipin() receive
EOF and exits immediately.
Suppose you have a serial console called ms in /etc/remote:

# screen -d -m tip ms
# screen -ls

You would not find the screen started detached.
--- tip.c.orig	Thu Jul  1 19:23:10 2004
+++ tip.c	Thu Jul  1 19:26:07 2004
@@ -241,6 +241,8 @@
 	ctermios.c_cc[VINTR] = 	ctermios.c_cc[VQUIT] = -1;
 	ctermios.c_cc[VSUSP] = ctermios.c_cc[VDSUSP] = ctermios.c_cc[VDISCARD] =
 		ctermios.c_cc[VLNEXT] = -1;
+	ctermios.c_cc[VMIN] = 1;
+	ctermios.c_cc[VTIME] = 0;
 #else /* HAVE_TERMIOS */
 	ioctl(0, TIOCGETP, (char *)&defarg);
 	ioctl(0, TIOCGETC, (char *)&defchars);



More information about the freebsd-bugs mailing list