How to force wraparound at col. 80

Chuck Karish karish at denali.stanford.edu
Fri Aug 19 10:00:48 AEST 1988


In article <4814 at netnews.upenn.edu> spolsky at eniac.seas.upenn.edu (Joel Spolsky) writes:
>Does anybody know how to convince Unix (Sun 3/260) how to
>automatically send a carriage return after 80 columns of output?

>We're using the Symbolics terminal emulator which SHOULD be emulating
>a VT-100, unfortunately, the emulation is flawed because it allows
>lines longer than 80 columns without wrapping.


This behavior is configurable on many terminals.  The capability is
usually called 'autowrap' or 'automatic margin'.  For many UNIX
utilities, choosing a termcap entry that lacks the 'am' boolean
fixes things.  I think there's one called 'vt100-nam'.
Terminfo files also have the 'am' attribute.

>The program we're using on the Sun (Sunlink 3270) assumes that the
>terminal will wrap at column 80, which it doesn't, so nothing comes
>out formatted correctly.

If the program doesn't use termcap or terminfo, things are more
complicated.  You'll have to write a program that will intercept the
standard streams, process stdout and stderr, and interact with the
application as if the user were doing it directly.  The terminal
I/O can be faked either by using a couple of extra pty's or by using
ioctl() calls with the TIOCSTI parameter, to convince the application
that piped input is actually coming from the keyboard.

Chuck Karish	ARPA:	karish at denali.stanford.edu
		BITNET:	karish%denali at forsythe.stanford.edu
		UUCP:	{decvax,hplabs!hpda}!mindcrf!karish
		USPS:	1825 California St. #5   Mountain View, CA 94041



More information about the Comp.unix.wizards mailing list