xterm-54.patch.txt

XFree86 3.9s - xterm patch #54 - 1997/10/17 - T.Dickey <dickey@clark.net>
 
This patch does the following:
 
        + correct a minor placement problem with the right scrollbar.
 
        + implement a new set of control sequences for switching between the
          normal and alternate VT100 screens.  These work around the older
          sequences limitation that required modification of the runtime
          $TERMCAP to cooperate with the titeInhibit resource (that can't work
          with terminfo).  I do this by moving all of the functionality of the
          rmcur terminfo capability into the control sequences.
 
        + implement the alternate-screen menu entry
 
--------------------------------------------------------------------------------
 doc/specs/xterm/ctlseqs.ms |    9 ++++
 programs/xterm/INSTALL     |    3 -
 programs/xterm/charproc.c  |   99 ++++++++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 programs/xterm/menu.c      |    5 !
 programs/xterm/menu.h      |    5 --
 programs/xterm/ptyx.h      |   31 +++++++++++++!
 programs/xterm/scrollbar.c |   16 ++++++-
 programs/xterm/terminfo    |   14 ++!!!!
 programs/xterm/xterm.h     |    3 -
 programs/xterm/xterm.man   |    2 
 10 files changed, 80 insertions, 12 deletions, 95 modifications
--------------------------------------------------------------------------------
Index: xterm/ctlseqs.ms
*** XFree86-3.9s/xc/doc/specs/xterm/ctlseqs.ms  Wed Aug 27 06:48:32 1997
--- XFree86-3.9s-patched/xc/doc/specs/xterm/ctlseqs.ms  Thu Oct 16 20:51:41 1997
***************
*** 782,787 ****
--- 782,791 ----
  See the section \fBMouse Tracking\fP.
    \*(Ps = \*1\*0\*0\*1 \(-> Use Hilite Mouse Tracking.
  See the section \fBMouse Tracking\fP.
+   \*(Ps = \*1\*0\*4\*7 \(-> Use Alternate Screen Buffer (unless
+ disabled by the \fBtiteInhibit\fP resource)
+   \*(Ps = \*1\*0\*4\*8 \(-> Save cursor as in DECSC (unless
+ disabled by the \fBtiteInhibit\fP resource)
  .
  .IP \\*(Cs\\*?\\*(Pm\\*s\\*l
  DEC Private Mode Reset (DECRST)
***************
*** 808,813 ****
--- 812,822 ----
    \*(Ps = \*1\*0\*0\*0 \(-> Don't Send Mouse X & Y on button press and
  release
    \*(Ps = \*1\*0\*0\*1 \(-> Don't Use Hilite Mouse Tracking
+   \*(Ps = \*1\*0\*4\*7 \(-> Use Normal Screen Buffer, clearing screen
+ first if in the Alternate Screen (unless
+ disabled by the \fBtiteInhibit\fP resource)
+   \*(Ps = \*1\*0\*4\*8 \(-> Restore cursor as in DECRC (unless
+ disabled by the \fBtiteInhibit\fP resource)
  .
  .IP \\*(Cs\\*?\\*(Pm\\*s\\*r
  Restore DEC Private Mode Values.  The value of \*(Ps previously saved is
Index: INSTALL
*** XFree86-3.9s/xc/programs/xterm/INSTALL      Tue Oct 14 21:40:58 1997
--- XFree86-3.9s-patched/xc/programs/xterm/INSTALL      Fri Oct 17 19:24:55 1997
***************
*** 51,56 ****
    --with-Xaw3d            link with Xaw 3d library
    --with-neXtaw           link with neXT Athena library
    --with-terminal-id[=V]  set default decTerminalID (default: vt100)
- 
- 
- -- $XFree86: xc/programs/xterm/INSTALL,v 3.3 1997/10/13 17:16:54 hohndel Exp $
--- 51,53 ----
Index: charproc.c
*** XFree86-3.9s/xc/programs/xterm/charproc.c   Tue Oct 14 21:40:58 1997
--- XFree86-3.9s-patched/xc/programs/xterm/charproc.c   Fri Oct 17 19:42:41 1997
***************
*** 2741,2752 ****
  #endif /* ALLOWLOGFILEONOFF */
                        break;
  #endif
                case 47:                /* alternate buffer */
                        if (!termw->misc.titeInhibit) {
!                           if(func == bitset)
                                ToAlternate(screen);
!                           else
                                FromAlternate(screen);
                        }
                        break;
                case 66:        /* DECNKM */
--- 2741,2757 ----
  #endif /* ALLOWLOGFILEONOFF */
                        break;
  #endif
+               case 1047:
                case 47:                /* alternate buffer */
                        if (!termw->misc.titeInhibit) {
!                           if(func == bitset) {
                                ToAlternate(screen);
!                           } else {
!                               if (screen->alternate
!                                && (param[i] == 1047))
!                                   ClearScreen(screen);
                                FromAlternate(screen);
+                           }
                        }
                        break;
                case 66:        /* DECNKM */
***************
*** 2769,2774 ****
--- 2774,2784 ----
                        else
                                screen->send_mouse_pos = 0;
                        break;
+               case 1048:
+                       if (!termw->misc.titeInhibit) {
+                               CursorRestore(termw, &screen->sc);
+                       }
+                       break;
                }
        }
  }
***************
*** 2786,2840 ****
        for (i = 0; i < nparam; i++) {
                switch (param[i]) {
                case 1:                 /* DECCKM                       */
!                       screen->save_modes[0] = termw->keyboard.flags &
!                        MODE_DECCKM;
                        break;
                case 3:                 /* DECCOLM                      */
                        if(screen->c132)
!                           screen->save_modes[1] = termw->flags & IN132COLUMNS;
                        break;
                case 4:                 /* DECSCLM (slow scroll)        */
!                       screen->save_modes[2] = termw->flags & SMOOTHSCROLL;
                        break;
                case 5:                 /* DECSCNM                      */
!                       screen->save_modes[3] = termw->flags & REVERSE_VIDEO;
                        break;
                case 6:                 /* DECOM                        */
!                       screen->save_modes[4] = termw->flags & ORIGIN;
                        break;
  
                case 7:                 /* DECAWM                       */
!                       screen->save_modes[5] = termw->flags & WRAPAROUND;
                        break;
                case 8:                 /* DECARM                       */
                        /* ignore autorepeat */
                        break;
                case 9:                 /* mouse bogus sequence */
!                       screen->save_modes[7] = screen->send_mouse_pos;
                        break;
                case 40:                /* 132 column mode              */
!                       screen->save_modes[8] = screen->c132;
                        break;
                case 41:                /* curses hack                  */
!                       screen->save_modes[9] = screen->curses;
                        break;
                case 44:                /* margin bell                  */
!                       screen->save_modes[12] = screen->marginbell;
                        break;
                case 45:                /* reverse wraparound   */
!                       screen->save_modes[13] = termw->flags & REVERSEWRAP;
                        break;
  #ifdef ALLOWLOGGING
                case 46:                /* logging              */
!                       screen->save_modes[14] = screen->logging;
                        break;
  #endif
                case 47:                /* alternate buffer             */
!                       screen->save_modes[15] = screen->alternate;
                        break;
                case 1000:              /* mouse bogus sequence         */
                case 1001:
!                       screen->save_modes[7] = screen->send_mouse_pos;
                        break;
                }
        }
--- 2796,2855 ----
        for (i = 0; i < nparam; i++) {
                switch (param[i]) {
                case 1:                 /* DECCKM                       */
!                       DoSM(DP_DECCKM, termw->keyboard.flags & MODE_DECCKM);
                        break;
                case 3:                 /* DECCOLM                      */
                        if(screen->c132)
!                           DoSM(DP_DECCOLM, termw->flags & IN132COLUMNS);
                        break;
                case 4:                 /* DECSCLM (slow scroll)        */
!                       DoSM(DP_DECSCLM, termw->flags & SMOOTHSCROLL);
                        break;
                case 5:                 /* DECSCNM                      */
!                       DoSM(DP_DECSCNM, termw->flags & REVERSE_VIDEO);
                        break;
                case 6:                 /* DECOM                        */
!                       DoSM(DP_DECOM, termw->flags & ORIGIN);
                        break;
  
                case 7:                 /* DECAWM                       */
!                       DoSM(DP_DECAWM, termw->flags & WRAPAROUND);
                        break;
                case 8:                 /* DECARM                       */
                        /* ignore autorepeat */
                        break;
                case 9:                 /* mouse bogus sequence */
!                       DoSM(DP_X_X10MSE, screen->send_mouse_pos);
                        break;
                case 40:                /* 132 column mode              */
!                       DoSM(DP_X_DECCOLM, screen->c132);
                        break;
                case 41:                /* curses hack                  */
!                       DoSM(DP_X_MORE, screen->curses);
                        break;
                case 44:                /* margin bell                  */
!                       DoSM(DP_X_MARGIN, screen->marginbell);
                        break;
                case 45:                /* reverse wraparound   */
!                       DoSM(DP_X_REVWRAP, termw->flags & REVERSEWRAP);
                        break;
  #ifdef ALLOWLOGGING
                case 46:                /* logging              */
!                       DoSM(DP_X_LOGGING, screen->logging);
                        break;
  #endif
+               case 1047:              /* alternate buffer             */
                case 47:                /* alternate buffer             */
!                       DoSM(DP_X_ALTSCRN, screen->alternate);
                        break;
                case 1000:              /* mouse bogus sequence         */
                case 1001:
!                       DoSM(DP_X_MOUSE, screen->send_mouse_pos);
!                       break;
!               case 1048:
!                       if (!termw->misc.titeInhibit) {
!                               CursorSave(termw, &screen->sc);
!                       }
                        break;
                }
        }
***************
*** 2854,2928 ****
                switch (param[i]) {
                case 1:                 /* DECCKM                       */
                        bitcpy(&termw->keyboard.flags,
!                               screen->save_modes[0], MODE_DECCKM);
                        update_appcursor();
                        break;
                case 3:                 /* DECCOLM                      */
                        if(screen->c132) {
                                ClearScreen(screen);
                                CursorSet(screen, 0, 0, termw->flags);
!                               if((j = (screen->save_modes[1] & IN132COLUMNS)
                                 ? 132 : 80) != ((termw->flags & IN132COLUMNS)
                                 ? 132 : 80) || j != screen->max_col + 1)
                                        RequestResize(termw, -1, j, TRUE);
                                bitcpy(&termw->flags,
!                                       screen->save_modes[1],
                                        IN132COLUMNS);
                        }
                        break;
                case 4:                 /* DECSCLM (slow scroll)        */
!                       if (screen->save_modes[2] & SMOOTHSCROLL) {
                                screen->jumpscroll = 0;
                                if (screen->scroll_amt)
                                        FlushScroll(screen);
                        } else
                                screen->jumpscroll = 1;
!                       bitcpy(&termw->flags, screen->save_modes[2], SMOOTHSCROLL);
                        update_jumpscroll();
                        break;
                case 5:                 /* DECSCNM                      */
!                       if((screen->save_modes[3] ^ termw->flags) & REVERSE_VIDEO) {
!                               bitcpy(&termw->flags, screen->save_modes[3], REVERSE_VIDEO);
                                ReverseVideo(termw);
                                /* update_reversevideo done in RevVid */
                        }
                        break;
                case 6:                 /* DECOM                        */
!                       bitcpy(&termw->flags, screen->save_modes[4], ORIGIN);
                        CursorSet(screen, 0, 0, termw->flags);
                        break;
  
                case 7:                 /* DECAWM                       */
!                       bitcpy(&termw->flags, screen->save_modes[5], WRAPAROUND);
                        update_autowrap();
                        break;
                case 8:                 /* DECARM                       */
                        /* ignore autorepeat */
                        break;
                case 9:                 /* MIT bogus sequence           */
!                       screen->send_mouse_pos = screen->save_modes[7];
                        break;
                case 40:                /* 132 column mode              */
!                       screen->c132 = screen->save_modes[8];
                        update_allow132();
                        break;
                case 41:                /* curses hack                  */
!                       screen->curses = screen->save_modes[9];
                        update_cursesemul();
                        break;
                case 44:                /* margin bell                  */
!                       if((screen->marginbell = screen->save_modes[12]) == 0)
                                screen->bellarmed = -1;
                        update_marginbell();
                        break;
                case 45:                /* reverse wraparound   */
!                       bitcpy(&termw->flags, screen->save_modes[13], REVERSEWRAP);
                        update_reversewrap();
                        break;
  #ifdef ALLOWLOGGING
                case 46:                /* logging              */
  #ifdef ALLOWLOGFILEONOFF
!                       if(screen->save_modes[14])
                                StartLog(screen);
                        else
                                CloseLog(screen);
--- 2869,2943 ----
                switch (param[i]) {
                case 1:                 /* DECCKM                       */
                        bitcpy(&termw->keyboard.flags,
!                               screen->save_modes[DP_DECCKM], MODE_DECCKM);
                        update_appcursor();
                        break;
                case 3:                 /* DECCOLM                      */
                        if(screen->c132) {
                                ClearScreen(screen);
                                CursorSet(screen, 0, 0, termw->flags);
!                               if((j = (screen->save_modes[DP_DECCOLM] & IN132COLUMNS)
                                 ? 132 : 80) != ((termw->flags & IN132COLUMNS)
                                 ? 132 : 80) || j != screen->max_col + 1)
                                        RequestResize(termw, -1, j, TRUE);
                                bitcpy(&termw->flags,
!                                       screen->save_modes[DP_DECCOLM],
                                        IN132COLUMNS);
                        }
                        break;
                case 4:                 /* DECSCLM (slow scroll)        */
!                       if (screen->save_modes[DP_DECSCLM] & SMOOTHSCROLL) {
                                screen->jumpscroll = 0;
                                if (screen->scroll_amt)
                                        FlushScroll(screen);
                        } else
                                screen->jumpscroll = 1;
!                       bitcpy(&termw->flags, screen->save_modes[DP_DECSCLM], SMOOTHSCROLL);
                        update_jumpscroll();
                        break;
                case 5:                 /* DECSCNM                      */
!                       if((screen->save_modes[DP_DECSCNM] ^ termw->flags) & REVERSE_VIDEO) {
!                               bitcpy(&termw->flags, screen->save_modes[DP_DECSCNM], REVERSE_VIDEO);
                                ReverseVideo(termw);
                                /* update_reversevideo done in RevVid */
                        }
                        break;
                case 6:                 /* DECOM                        */
!                       bitcpy(&termw->flags, screen->save_modes[DP_DECOM], ORIGIN);
                        CursorSet(screen, 0, 0, termw->flags);
                        break;
  
                case 7:                 /* DECAWM                       */
!                       bitcpy(&termw->flags, screen->save_modes[DP_DECAWM], WRAPAROUND);
                        update_autowrap();
                        break;
                case 8:                 /* DECARM                       */
                        /* ignore autorepeat */
                        break;
                case 9:                 /* MIT bogus sequence           */
!                       DoRM(DP_X_X10MSE, screen->send_mouse_pos);
                        break;
                case 40:                /* 132 column mode              */
!                       DoRM(DP_X_DECCOLM, screen->c132);
                        update_allow132();
                        break;
                case 41:                /* curses hack                  */
!                       DoRM(DP_X_MORE, screen->curses);
                        update_cursesemul();
                        break;
                case 44:                /* margin bell                  */
!                       if((DoRM(DP_X_MARGIN, screen->marginbell)) == 0)
                                screen->bellarmed = -1;
                        update_marginbell();
                        break;
                case 45:                /* reverse wraparound   */
!                       bitcpy(&termw->flags, screen->save_modes[DP_X_REVWRAP], REVERSEWRAP);
                        update_reversewrap();
                        break;
  #ifdef ALLOWLOGGING
                case 46:                /* logging              */
  #ifdef ALLOWLOGFILEONOFF
!                       if(screen->save_modes[DP_X_LOGGING])
                                StartLog(screen);
                        else
                                CloseLog(screen);
***************
*** 2930,2938 ****
                        /* update_logging done by StartLog and CloseLog */
                        break;
  #endif
                case 47:                /* alternate buffer */
                        if (!termw->misc.titeInhibit) {
!                           if(screen->save_modes[15])
                                ToAlternate(screen);
                            else
                                FromAlternate(screen);
--- 2945,2954 ----
                        /* update_logging done by StartLog and CloseLog */
                        break;
  #endif
+               case 1047:              /* alternate buffer */
                case 47:                /* alternate buffer */
                        if (!termw->misc.titeInhibit) {
!                           if(screen->save_modes[DP_X_ALTSCRN])
                                ToAlternate(screen);
                            else
                                FromAlternate(screen);
***************
*** 2941,2947 ****
                        break;
                case 1000:              /* mouse bogus sequence         */
                case 1001:
!                       screen->send_mouse_pos = screen->save_modes[7];
                        break;
                }
        }
--- 2957,2968 ----
                        break;
                case 1000:              /* mouse bogus sequence         */
                case 1001:
!                       DoRM(DP_X_MOUSE, screen->send_mouse_pos);
!                       break;
!               case 1048:
!                       if (!termw->misc.titeInhibit) {
!                               CursorRestore(termw, &screen->sc);
!                       }
                        break;
                }
        }
***************
*** 3231,3236 ****
--- 3252,3267 ----
                register TScreen *screen = &term->screen;
                dotext(screen, screen->gsets[(int)(screen->curgl)], buf, buf+i);
        }
+ }
+ 
+ void
+ ToggleAlternate(screen)
+     register TScreen *screen;
+ {
+       if (screen->alternate)
+               FromAlternate(screen);
+       else
+               ToAlternate(screen);
  }
  
  static void
Index: menu.c
*** XFree86-3.9s/xc/programs/xterm/menu.c       Tue Sep 30 07:04:42 1997
--- XFree86-3.9s-patched/xc/programs/xterm/menu.c       Fri Oct 17 19:44:03 1997
***************
*** 277,284 ****
            screen->vtMenu = create_menu (term, toplevel, "vtMenu",
                                          vtMenuEntries,
                                          XtNumber(vtMenuEntries));
-           /* and turn off the alternate screen entry */
-           set_altscreen_sensitivity (FALSE);
            update_scrollbar();
            update_jumpscroll();
            update_reversevideo();
--- 277,282 ----
***************
*** 790,796 ****
      Widget gw GCC_UNUSED;
      XtPointer closure GCC_UNUSED, data GCC_UNUSED;
  {
!     /* do nothing for now; eventually, will want to flip screen */
  }
  
  #ifndef NO_ACTIVE_ICON
--- 788,795 ----
      Widget gw GCC_UNUSED;
      XtPointer closure GCC_UNUSED, data GCC_UNUSED;
  {
!     TScreen *screen = &term->screen;
!     ToggleAlternate(screen);
  }
  
  #ifndef NO_ACTIVE_ICON
Index: menu.h
*** XFree86-3.9s/xc/programs/xterm/menu.h       Fri Sep 19 13:58:52 1997
--- XFree86-3.9s-patched/xc/programs/xterm/menu.h       Fri Oct 17 19:37:18 1997
***************
*** 364,374 ****
                   tekMenuEntries[tekMenu_tekhide].widget, \
                   term->screen.Vshow)
  
- #define set_altscreen_sensitivity(val) \
-   set_sensitivity (term->screen.vtMenu,\
-                  vtMenuEntries[vtMenu_altscreen].widget, (val))
- 
- 
  /*
   * macros for mapping font size to tekMenu placement
   */
--- 364,369 ----
Index: ptyx.h
*** XFree86-3.9s/xc/programs/xterm/ptyx.h       Tue Oct 14 21:40:58 1997
--- XFree86-3.9s-patched/xc/programs/xterm/ptyx.h       Fri Oct 17 19:24:18 1997
***************
*** 479,484 ****
--- 479,513 ----
  #define SCRN_BUF_CSETS(screen, row) BUF_CSETS(screen->buf, row)
  #endif
  
+       /* indices into save_modes[] */
+ typedef enum {
+       DP_DECCKM,
+       DP_DECANM,
+       DP_DECCOLM,     /* IN132COLUMNS */
+       DP_DECSCLM,
+       DP_DECSCNM,
+       DP_DECOM,
+       DP_DECAWM,
+       DP_DECARM,
+       DP_X_X10MSE,
+       DP_DECPFF,
+       DP_DECPEX,
+       DP_DECTCEM,
+       DP_DECTEK,
+       DP_X_DECCOLM,
+       DP_X_MORE,
+       DP_X_MARGIN,
+       DP_X_REVWRAP,
+       DP_X_LOGGING,
+       DP_X_ALTSCRN,
+       DP_DECBKM,
+       DP_X_MOUSE,
+       DP_LAST
+       } SaveModes;
+ 
+ #define DoSM(code,value) screen->save_modes[code] = value
+ #define DoRM(code,value) value = screen->save_modes[code]
+ 
  typedef struct {
  /* These parameters apply to both windows */
        Display         *display;       /* X display for screen         */
***************
*** 613,619 ****
        int             scrolls;        /* outstanding scroll count,
                                            used only with multiscroll  */
        SavedCursor     sc;             /* data for restore cursor      */
!       int             save_modes[19]; /* save dec private modes       */
  
        /* Improved VT100 emulation stuff.                              */
        char            gsets[4];       /* G0 through G3.               */
--- 642,648 ----
        int             scrolls;        /* outstanding scroll count,
                                            used only with multiscroll  */
        SavedCursor     sc;             /* data for restore cursor      */
!       int             save_modes[24]; /* save dec/xterm private modes */
  
        /* Improved VT100 emulation stuff.                              */
        char            gsets[4];       /* G0 through G3.               */
Index: scrollbar.c
*** XFree86-3.9s/xc/programs/xterm/scrollbar.c  Tue Oct 14 21:40:58 1997
--- XFree86-3.9s-patched/xc/programs/xterm/scrollbar.c  Fri Oct 17 19:23:43 1997
***************
*** 344,350 ****
      int init, doalloc;
  {
        register TScreen *screen = &xw->screen;
-       register int border = 2 * screen->border;
        register int i;
  
        if(screen->fullVwin.scrollbar)
--- 344,349 ----
***************
*** 395,400 ****
--- 394,414 ----
  
        ScrollBarDrawThumb(screen->scrollWidget);
        DoResizeScreen (xw);
+ 
+ #ifdef SCROLLBAR_RIGHT
+       /*
+        * Adjust the scrollbar position if we're asked to turn on scrollbars
+        * for the first time after the xterm is already running.  That makes
+        * the window grow after we've initially configured the scrollbar's
+        * position.  (There must be a better way).
+        */
+       if (term->misc.useRight
+        && screen->fullVwin.fullwidth < term->core.width)
+           XtVaSetValues(screen->scrollWidget,
+               XtNx, screen->fullVwin.fullwidth - screen->scrollWidget->core.border_width,
+               NULL);
+ #endif
+ 
        XtMapWidget(screen->scrollWidget);
        update_scrollbar ();
        if (screen->buf) {
Index: terminfo
*** XFree86-3.9s/xc/programs/xterm/terminfo     Wed Aug 27 06:48:32 1997
--- XFree86-3.9s-patched/xc/programs/xterm/terminfo     Thu Oct 16 19:23:13 1997
***************
*** 1,6 ****
--- 1,12 ----
  # $XConsortium: terminfo,v 1.11 94/10/13 21:24:31 gildea Exp $
  # $XFree86: xc/programs/xterm/terminfo,v 3.18 1997/08/26 10:01:59 hohndel Exp $
+ #
  # meml locks memory above the cursor; memu unlocks (ala HP terminals)
+ # rmcup clears memory before switching to the alternate screen.  The older
+ #     (deprecated) \E[?47h did not do this, requiring applications to
+ #     embed a \E[2J in the rmcup string.  However, that behavior cannot
+ #     be disabled via titeInhibit, making that resource not function as
+ #     intended on systems with terminfo.
  #
  xterm|xterm-24|xterms|vs100|xterm terminal emulator (X Window System),
        am,
***************
*** 106,112 ****
        ri=\EM,
        rmacs=^O,
        rmam=\E[?7l,
!       rmcup=\E[2J\E[?47l\E8,
        rmir=\E[4l,
        rmkx=\E[?1l\E>,
        rmso=\E[27m,
--- 112,118 ----
        ri=\EM,
        rmacs=^O,
        rmam=\E[?7l,
!       rmcup=\E[?1047l\E[?1048l,
        rmir=\E[4l,
        rmkx=\E[?1l\E>,
        rmso=\E[27m,
***************
*** 122,128 ****
        sgr0=\E[m\017,
        smacs=^N,
        smam=\E[?7h,
!       smcup=\E7\E[?47h,
        smir=\E[4h,
        smkx=\E[?1h\E=,
        smso=\E[7m,
--- 128,134 ----
        sgr0=\E[m\017,
        smacs=^N,
        smam=\E[?7h,
!       smcup=\E[?1048h\E[?1047h,
        smir=\E[4h,
        smkx=\E[?1h\E=,
        smso=\E[7m,
***************
*** 309,315 ****
        ri=\215,
        rmacs=^O,
        rmam=\233?7l,
!       rmcup=\2332J\233?47l\E8,
        rmir=\2334l,
        rmkx=\233?1l\E>,
        rmso=\23327m,
--- 315,321 ----
        ri=\215,
        rmacs=^O,
        rmam=\233?7l,
!       rmcup=\233?1047l\233?1048l,
        rmir=\2334l,
        rmkx=\233?1l\E>,
        rmso=\23327m,
***************
*** 325,331 ****
        sgr0=\233m\017,
        smacs=^N,
        smam=\233?7h,
!       smcup=\E7\233?47h,
        smir=\2334h,
        smkx=\233?1h\E=,
        smso=\2337m,
--- 331,337 ----
        sgr0=\233m\017,
        smacs=^N,
        smam=\233?7h,
!       smcup=\233?1048h\233?1047h,
        smir=\2334h,
        smkx=\233?1h\E=,
        smso=\2337m,
Index: xterm.h
*** XFree86-3.9s/xc/programs/xterm/xterm.h      Tue Oct 14 21:40:58 1997
--- XFree86-3.9s-patched/xc/programs/xterm/xterm.h      Fri Oct 17 19:43:29 1997
***************
*** 63,74 ****
  extern void SetVTFont PROTO((int i, Bool doresize, char *name1, char *name2));
  extern void ShowCursor PROTO((void));
  extern void SwitchBufPtrs PROTO((TScreen *screen));
  extern void VTReset PROTO((int full));
  extern void VTRun PROTO((void));
  extern void dotext PROTO((TScreen *screen, int charset, Char *buf, Char *ptr));
  extern void set_cursor_gcs PROTO((TScreen *screen));
- extern void unparseputc1 PROTO((int c, int fd));
  extern void unparseputc PROTO((int c, int fd));
  extern void unparseseq PROTO((ANSI *ap, int fd));
  
  #if OPT_ISO_COLORS
--- 63,75 ----
  extern void SetVTFont PROTO((int i, Bool doresize, char *name1, char *name2));
  extern void ShowCursor PROTO((void));
  extern void SwitchBufPtrs PROTO((TScreen *screen));
+ extern void ToggleAlternate PROTO((TScreen *screen));
  extern void VTReset PROTO((int full));
  extern void VTRun PROTO((void));
  extern void dotext PROTO((TScreen *screen, int charset, Char *buf, Char *ptr));
  extern void set_cursor_gcs PROTO((TScreen *screen));
  extern void unparseputc PROTO((int c, int fd));
+ extern void unparseputc1 PROTO((int c, int fd));
  extern void unparseseq PROTO((ANSI *ap, int fd));
  
  #if OPT_ISO_COLORS
Index: xterm.man
*** XFree86-3.9s/xc/programs/xterm/xterm.man    Tue Oct 14 21:40:58 1997
--- XFree86-3.9s-patched/xc/programs/xterm/xterm.man    Fri Oct 17 19:46:07 1997
***************
*** 1173,1179 ****
  This entry invokes the \fBset-marginbell(toggle)\fP action.
  .TP 8
  .B "altscreen (\fPclass\fB SmeBSB)"
! This entry is currently disabled.
  .TP 8
  .B "activeicon (\fPclass\fB SMeBSB)"
  This entry toggles active icons on and off if this feature was
--- 1173,1179 ----
  This entry invokes the \fBset-marginbell(toggle)\fP action.
  .TP 8
  .B "altscreen (\fPclass\fB SmeBSB)"
! This entry invokes the \fBset-altscreen(toggle)\fP action.
  .TP 8
  .B "activeicon (\fPclass\fB SMeBSB)"
  This entry toggles active icons on and off if this feature was