From owner-freebsd-bugs@FreeBSD.ORG Sat Nov 13 15:38:50 2010 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B605106566B for ; Sat, 13 Nov 2010 15:38:50 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (ns2.r-bonomi.com [204.87.227.129]) by mx1.freebsd.org (Postfix) with ESMTP id E027E8FC0C for ; Sat, 13 Nov 2010 15:38:49 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.3/rdb1) id oADFad5B024105; Sat, 13 Nov 2010 09:36:39 -0600 (CST) Date: Sat, 13 Nov 2010 09:36:39 -0600 (CST) From: Robert Bonomi Message-ID: <201011131536.oADFad5B024105@mail.r-bonomi.com> To: brde@optusnet.com.au Cc: freebsd-bugs@freebsd.org, FreeBSD-gnats-submit@freebsd.org, rfg@tristatelogic.com Subject: Re: bin/152154: /bin/csh & /bin/tcsh improperly diddle termios flags X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2010 15:38:50 -0000 > From owner-freebsd-bugs@freebsd.org Fri Nov 12 03:46:22 2010 > Date: Fri, 12 Nov 2010 20:48:08 +1100 (EST) > From: Bruce Evans > Subject: Re: bin/152154: /bin/csh & /bin/tcsh improperly diddle termios flags > > On Fri, 12 Nov 2010, Bruce Evans wrote: > > > I just remembered a related problem. I often mistype command lines, > or do complicated editing of them involving many backspaces and other > control characters to move around or search history. script makes a > mess of this by showing all the control characters, even without -k. This is _documented behavior_. It is, also, essentially inescapable. " BUGS Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. " It is also documented in the body of the description: " The script utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. " Aside: some of us _count_ on script behaving that way -- capturing _every_ character sent out. Script has -no- way of knowing what is echoed 'editing' characters, and what is 'significant' output. *ALL* script 'guarantees' -- in the situation involving an 'addressable' terminal -- is that if you play back the logfile to the _same_ type of terminal is that 'what you see' on the screen on replay is "what you got' originally. True "WYSIWYG". > The only way to handle this right might be to have the line editor in > script itself ... That works _UNTIL_ you need to pass a 'line edit' character to an application. Heaven forbid you forget you have script running, and invoke a full-screen editor (or any-other full-scrren utility for that matter) that uses one of the line-edit characters as it's "exit" sequence. And, even doing _that_ does not help with the 'mess' created by rummaging through, say, the csh cmommand history. A script functionality integrated into whichever CLI (shell) one uses could eliminate the line-edit / history, etc. "mess" from the logfile, but that is 'no help' in dealing with _all_ the other programs that produce output "assuming" an 'addressable' display. How do you log a 'vi' session, for example? For a 'cleaner' typescript, set the TERM environment variable to 'dumb'.