bin/152154: /bin/csh & /bin/tcsh improperly diddle termios flags
Robert Bonomi
bonomi at mail.r-bonomi.com
Sat Nov 13 15:38:50 UTC 2010
> From owner-freebsd-bugs at freebsd.org Fri Nov 12 03:46:22 2010
> Date: Fri, 12 Nov 2010 20:48:08 +1100 (EST)
> From: Bruce Evans <brde at optusnet.com.au>
> 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". <grin>
> 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? <evil grin>
For a 'cleaner' typescript, set the TERM environment variable to 'dumb'.
More information about the freebsd-bugs
mailing list