Stuart Henderson wrote on Wed, Aug 06, 2008 at 03:00:43PM +0000:

> Let's make it easier for people to test;
> $ printf "1\t\t\t\t\t\t\t\t\t1234567\t123"

Or even:

 $ printf "\t\t\t\t\t\t\t\t\t\tX\n"

These are ten tabs.  Each tab is supposed to be 8 characters wide.
Thus, the X is supposed to appear in column 81.  When the xterm is at
least 81 characters wide, the X does appear in column 81.  When the
width is 80 characters or less, the X appears in the last column.
In other words, a tab never makes xterm wrap to the next line.
A blank character does, as you can see from

 $ printf "\t\t\t\t\t\t\t\t\t\t X\n"

I quickly realized that reset(1) solves the issue and that
even `tset -I` is sufficient.  Actually, tset(1) uses
tcsetattr(3) OXTABS.  You can have the same effect manually
with `stty oxtabs` and the problem is gone; then `stty -oxtabs`
and the problem is back.  That oxtabs gets switched on by default
stems from the fact that /usr/src/share/termtypes/termtypes.master
has no OTpt for xterm-r6.

What i do not yet understand is why xterm has -oxtabs
by default but the terminfo(5) database has no OTpt for it.
Isn't that inconsistent?


Christian Weisgerber wrote on Wed, 6 Aug 2008 17:43:04 +0000 (UTC):

> I have taken my DEC VT220 from the shelf and xterm matches
> its behavior.

In any case, the VT220 *has* hardware tabs.
That's also stated by :pt: in terminfo(5).

Now, *IF* xterm is supposed to emulate VT220 and thus xterm default
behaviour is considered correct, then the logical consequence would be
the following patch.  I'm not sure this is correct, quite possibly i'm
overlooking something, and even if it is correct, it's probably 
incomplete, but maybe somebody more knowledgeable regarding
termios(4) can judge this (after the release is done).


Index: share/termtypes/termtypes.master
===================================================================
RCS file: /cvs/src/share/termtypes/termtypes.master,v
retrieving revision 1.36
diff -u -r1.36 termtypes.master
--- share/termtypes/termtypes.master    25 Jun 2007 15:57:28 -0000      1.36
+++ share/termtypes/termtypes.master    6 Aug 2008 21:56:43 -0000
@@ -2538,7 +2538,7 @@
 # (khome/kend do not actually work in X11R5 or X11R6, but many people use this
 # for compatibility with other emulators).
 xterm-r6|xterm-old|xterm X11R6 version, 
-       OTbs, am, km, mir, msgr, xenl, 
+       OTbs, OTpt, am, km, mir, msgr, xenl, 
        cols#80, it#8, lines#24, 
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 
        bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M, 

Reply via email to