From cedar!jeremy@beaver.cs.washington.edu  Wed Sep 11 06:01:32 1996
Received: from beaver.cs.washington.edu (beaver.cs.washington.edu [128.95.1.1])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id GAA01418
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Sep 1996 06:01:32 -0700 (PDT)
Received: from cedar.UUCP (uucp@localhost) by beaver.cs.washington.edu (8.7.5/7.1be+) with UUCP id GAA14254 for freebsd.org!FreeBSD-gnats-submit; Wed, 11 Sep 1996 06:01:31 -0700 (PDT)
Received: from localhost by rocky.cedar.wa.com (8.3/1.36)
	id AAA11821; Wed, 11 Sep 1996 00:39:09 -0700
Message-Id: <199609110739.AAA11821@rocky.cedar.wa.com>
Date: Wed Sep 11 00:32:04 1996
From: cedar!jeremy@beaver.cs.washington.edu (Jeremy Scofield)
To: FreeBSD-gnats-submit@freebsd.org
Subject: tip leaves OPOST set on controlling terminal

>Number:         1598
>Category:       bin
>Synopsis:       tip leaves OPOST set on controlling terminal (fd 0)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 11 06:10:01 PDT 1996
>Closed-Date:    Sat May 23 02:24:57 PDT 1998
>Last-Modified:  Sat May 23 02:25:05 PDT 1998
>Originator:     Jeremy Scofield
>Release:        FreeBSD 2.1.5-RELEASE i386
>Organization:
Cedar River Software
>Environment:

It's not particularly relevant, but my /etc/remote contains

    cuaa1:dv=/dev/cuaa1:br#115200:pa=none

>Description:

The raw() function in tip.c leaves OPOST and ONLCR set on fd 0, which
causes an extra \r to be inserted before each \n.  This is fairly
benign when running line-mode commands (\r\r\n is usually
indistinguishable from \r\n), but causes some pretty strange behavior
when I run vi on the remote system.

I checked tip.c in FreeBSD-current, too.  The bug is still there.

>How-To-Repeat:

    script
    tip cuaa1
	<call remote system>
    ~.
    ^D

The ``typescript'' file will show double \r's at the end of every line.

>Fix:

*** tip.c-orig	Tue Sep 10 23:37:04 1996
--- tip.c	Tue Sep 10 23:37:24 1996
***************
*** 223,228 ****
--- 223,229 ----
  	ctermios.c_iflag = (ISTRIP|IXON|BRKINT);
  	ctermios.c_lflag = (PENDIN|IEXTEN|ISIG|ECHOE);
  #endif
+ 	ctermios.c_oflag = 0;
  	ctermios.c_cflag = (CLOCAL|HUPCL|CREAD|CS8);
  	ctermios.c_cc[VINTR] = 	ctermios.c_cc[VQUIT] = -1;
  	ctermios.c_cc[VSUSP] = ctermios.c_cc[VDSUSP] = ctermios.c_cc[VDISCARD] =
>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: cedar!jeremy@beaver.cs.washington.edu, FreeBSD-gnats-submit@freebsd.org
Cc:  Subject: Re: bin/1598: tip leaves OPOST set on controlling terminal
Date: Thu, 12 Sep 1996 04:18:40 +1000

 >*** tip.c-orig	Tue Sep 10 23:37:04 1996
 >--- tip.c	Tue Sep 10 23:37:24 1996
 >***************
 >*** 223,228 ****
 >--- 223,229 ----
 >  	ctermios.c_iflag = (ISTRIP|IXON|BRKINT);
 >  	ctermios.c_lflag = (PENDIN|IEXTEN|ISIG|ECHOE);
 >  #endif
 >+ 	ctermios.c_oflag = 0;
 >  	ctermios.c_cflag = (CLOCAL|HUPCL|CREAD|CS8);
 >  	ctermios.c_cc[VINTR] = 	ctermios.c_cc[VQUIT] = -1;
 >  	ctermios.c_cc[VSUSP] = ctermios.c_cc[VDSUSP] = ctermios.c_cc[VDISCARD] =
 
 Every line in this is buggy.  Setting flags other than the POSIX
 ones gives undefined behaviour.  In practice, it may clear CRTSCTS.
 -1 should be _POSIX_VDISABLE.  It works because (cc_t)-1 happens to
 equal _POSIX_VDISABLE under FreeBSD.
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sat May 23 02:24:57 PDT 1998 
State-Changed-Why:  

As part of our PR auditing campaign, this PR has been closed due to it's 
age and lack of activity on the PR.   

There is a good chance that the problem reported have been solved  
as part of other activities. 

If this is not the case, please reopen this PR with fresh information 
on the manifestation of the bug. 

Sorry about the late reaction to this PR. 
>Unformatted:
