xterm-32.patch.txt

xterm - patch #32 - 1996/11/21 - T.Dickey
 
This implements the REP (repeat) control for xterm.  That isn't part of the DEC
VTxxx series, but is defined in ISO 6429.  (Note that the base xterm terminal
description is _not_ changed -- I added a variant, "xterm-rep").
 
--------------------------------------------------------------------------------
 doc/specs/xterm/ctlseqs.ms |    3 +++
 programs/xterm/VTPrsTbl.c  |    2 !!
 programs/xterm/VTparse.def |    1 +
 programs/xterm/VTparse.h   |    1 +
 programs/xterm/charproc.c  |   30 ++++++++++++++++++++++-!!!!!!!
 programs/xterm/terminfo    |    4 ++++
 6 files changed, 31 insertions, 1 deletion, 9 modifications
--------------------------------------------------------------------------------
Index: ctlseqs.ms
*** XFree86-3.2b/xc/doc/specs/xterm/ctlseqs.ms  Mon Nov 18 13:58:37 1996
--- XFree86-current/xc/doc/specs/xterm/ctlseqs.ms       Thu Nov 21 18:22:10 1996
***************
*** 559,564 ****
--- 559,567 ----
  .IP \\*(Cs\\*(Ps\\*s\\*^
  Scroll down \*(Ps lines (default = 1) (SD, according to ISO)
  .
+ .IP \\*(Cs\\*(Ps\\*s\\*b
+ Repeat the preceding graphic character \*(Ps times.
+ .
  .IP \\*(Cs\\*(Ps\\*s\\*c
  Send Device Attributes (DA)
    \*(Ps = \*0 or omitted \(-> request attributes from terminal
Index: VTPrsTbl.c
*** XFree86-3.2b/xc/programs/xterm/VTPrsTbl.c   Mon Nov 18 13:58:37 1996
--- XFree86-current/xc/programs/xterm/VTPrsTbl.c        Thu Nov 21 18:22:10 1996
***************
*** 485,491 ****
  /*    `               a               b               c       */
  CASE_HPA,
  CASE_GROUND_STATE,
! CASE_GROUND_STATE,
  CASE_DA1,
  /*    d               e               f               g       */
  CASE_VPA,
--- 485,491 ----
  /*    `               a               b               c       */
  CASE_HPA,
  CASE_GROUND_STATE,
! CASE_REP,
  CASE_DA1,
  /*    d               e               f               g       */
  CASE_VPA,
Index: VTparse.def
*** XFree86-3.2b/xc/programs/xterm/VTparse.def  Mon Nov 18 13:58:37 1996
--- XFree86-current/xc/programs/xterm/VTparse.def       Thu Nov 21 18:22:10 1996
***************
*** 114,116 ****
--- 114,117 ----
  CASE_DEC3_STATE
  CASE_DECRPTUI
  CASE_VT52_CUP
+ CASE_REP
Index: VTparse.h
*** XFree86-3.2b/xc/programs/xterm/VTparse.h    Mon Nov 18 13:58:37 1996
--- XFree86-current/xc/programs/xterm/VTparse.h Thu Nov 21 18:22:10 1996
***************
*** 175,177 ****
--- 175,178 ----
  #define CASE_DEC3_STATE 104
  #define CASE_DECRPTUI 105
  #define CASE_VT52_CUP 106
+ #define CASE_REP 107
Index: charproc.c
*** XFree86-3.2b/xc/programs/xterm/charproc.c   Mon Nov 18 13:58:37 1996
--- XFree86-current/xc/programs/xterm/charproc.c        Thu Nov 21 18:22:10 1996
***************
*** 859,864 ****
--- 859,865 ----
        register int row, col, top, bot, scstype, count;
        Bool private_function;  /* distinguish private-mode from standard */
        int string_mode;        /* nonzero iff we're processing a string */
+       int lastchar;           /* positive iff we had a graphic character */
  
        /* We longjmp back to this point in VTReset() */
        (void)setjmp(vtjmpbuf);
***************
*** 868,875 ****
--- 869,878 ----
        scstype = 0;
        private_function = False;
        string_mode = 0;
+       lastchar = -1;
  
        for( ; ; ) {
+             int thischar = -1;
            c = doinput();
  
            /* Accumulate string for APC, DCS, PM, OSC, SOS controls */
***************
*** 926,945 ****
                                cp++;
                        }
                        if(screen->curss) {
                                dotext(screen, term->flags,
                                 screen->gsets[(int)(screen->curss)],
                                        bptr, bptr + 1,
                                        term->cur_foreground,
                                        term->cur_background );
                                screen->curss = 0;
-                               bptr++;
                        }
!                       if(bptr < cp)
                                dotext(screen, term->flags,
                                 screen->gsets[(int)(screen->curgl)],
                                        bptr, cp,
                                        term->cur_foreground,
                                        term->cur_background );
                        bptr = cp;
                        break;
  
--- 929,950 ----
                                cp++;
                        }
                        if(screen->curss) {
+                               thischar = *bptr;
                                dotext(screen, term->flags,
                                 screen->gsets[(int)(screen->curss)],
                                        bptr, bptr + 1,
                                        term->cur_foreground,
                                        term->cur_background );
                                screen->curss = 0;
                        }
!                       if(bptr < cp) {
!                               thischar = cp[-1];
                                dotext(screen, term->flags,
                                 screen->gsets[(int)(screen->curgl)],
                                        bptr, cp,
                                        term->cur_foreground,
                                        term->cur_background );
+                       }
                        bptr = cp;
                        break;
  
***************
*** 1859,1864 ****
--- 1864,1886 ----
                        parsestate = groundtable;
                        break;
  
+                case CASE_REP:
+                       /* REP */
+                       if (lastchar >= 0 && isprint(lastchar)) {
+                           Char repeated[2];
+                           count = (param[0] < 1) ? 1 : param[0];
+                           repeated[0] = lastchar;
+                           while (count-- > 0) {
+                               dotext(screen, term->flags,
+                                       screen->gsets[(int)(screen->curgl)],
+                                       repeated, repeated+1,
+                                       term->cur_foreground,
+                                       term->cur_background );
+                           }
+                       }
+                       parsestate = groundtable;
+                       break;
+ 
                 case CASE_LS2:
                        /* LS2 */
                        screen->curgl = 2;
***************
*** 1903,1909 ****
                        window_ops(term);
                        parsestate = groundtable;
                        break;
!               }
        }
  }
  
--- 1925,1933 ----
                        window_ops(term);
                        parsestate = groundtable;
                        break;
!           }
!           if (parsestate == groundtable)
!                   lastchar = thischar;
        }
  }
  
Index: terminfo
*** XFree86-3.2b/xc/programs/xterm/terminfo     Sun Oct 20 15:05:16 1996
--- XFree86-current/xc/programs/xterm/terminfo  Thu Nov 21 18:23:23 1996
***************
*** 157,162 ****
--- 157,166 ----
        smir@,
        use=xterm,
  #
+ xterm-rep|xterm with repeat-character control,
+       rep=%p1%c\E[%p2%{1}%-%db,
+       use=xterm,
+ #
  # Compatible with the R6 xterm
  xterm-r6|xterm-old|xterm X11R6 version,
        is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>,