[comp.unix.sysv386] Fix for broken tabstops on AT&T Sys V/386

friedl@mtndew.Tustin.CA.US (Steve Friedl) (09/22/90)

Hi folks,

     There is a bug in AT&T System V/386 Release 3.2 (and
probably others) where the final console tabstop doesn't work.
If you have a file containing the following (pretend column
numbers start at zero):

        8       16      24      32      40      48      56      64      72
        v       v       v       v       v       v       v       v       v

with tabs between, the final "72 v" will appear at the start of
the following line.  Vi and other programs depending on tabs will
fail miserably, and the workaround has been to do `stty tab3' to
have the driver do tab expansion (don't try this in ksh because
*it* does tabs right).

     The big bummer is when working remotely with cu.  The OTHER
end has to have the `stty tab3', and I really hate to transmit 8
spaces instead of one tab, especially when working at 1200bps --
I have one customer like this :-(

     /usr/include/sys/at_ansi.h contains a "struct ansistate"
that has (among other things) a list of tabstops, but I could
never find any kind of ioctl that would give me access to it.
After digging around, I found that I can get at this struct by
poking around in /dev/kmem and have now fixed the problem so that
tabs work the right way.  I've been running this for a couple of
weeks now and am totally delighted with the fix.

     I have no idea if this is broken on other versions of UNIX,
but I have fixed it on my machine.  Before I post the source to this
I would like to have others suffering from this problem give my
code a try first.  Those interested should send me mail and
I'll send you the code.

     Steve

-- 
Stephen J. Friedl, KA8CMY / I speak for me only / Tustin, CA / 3B2-kind-of-guy
+1 714 544 6561  / friedl@mtndew.Tustin.CA.US  / {uunet,attmail}!mtndew!friedl

Jesse Helms for U.S. Supreme Court Justice

jim@segue.segue.com (Jim Balter) (09/22/90)

In article <523@mtndew.Tustin.CA.US> friedl@mtndew.Tustin.CA.US (Steve Friedl) writes:
>     There is a bug in AT&T System V/386 Release 3.2 (and
>probably others) where the final console tabstop doesn't work.

I gave Interactive a fix for this that made it into 386/IX 2.2.
You should be able to get around it in other systems by setting tabstops by
positioning the cursor (e.g., with <ESC>[1;72H) and then setting the tab by
writing <ESC>H .