OpenSolaris

Printable Version Enter a New Search
Bug ID 6569261
Synopsis xterm, xtermc, xterm-color: smcup/rmcup definitions are incorrect/missing
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:terminal
Keywords rtiq_reviewed
Responsible Engineer Brian Utterback
Reported Against snv_65
Duplicate Of
Introduced In solaris_2.0
Commit to Fix snv_76
Fixed In snv_76
Release Fixed solaris_nevada(snv_76)
Related Bugs 6512285 , 6622763 , 6640563 , 5053694
Submit Date 13-June-2007
Last Update Date 9-January-2008
Description
terminfo(4) defines smcup and rmcup as follows:

       exit_ca_mode       rmcup  te       String to end programs
                                          that use cup

       enter_ca_mode      smcup  ti       String to begin programs
                                          that use cup

These sequences are typically used by terminal applications that
control the cursor (eg vi). smcup switches to an alternate screen
buffer, rmcup switches back.

The practical effect of this is that the scrolling screen buffer
is replaced by a non-scrolling screen buffer when running vi and
*restored* when vi exits.

The rmcup/smcup terminfo descriptions fail to work on Solaris
xterm and gnome-terminal implementations. The scolling buffer
is not restored and, in some cases, strange escape sequences
are seen (eg mysterious '0' characters).

The Solaris xtermc and xterm-color terminfo defines:

    rmcup=\E@0\E[?4r
    smcup=\E@0\E[?4s\E[?4h\E@1

These escape sequences don't make much sense for xterm. The xterm terminfo
has nothing for rmcup/smcup.

The Sun Freeware terminfo definitions are more as expected:

  xterm-color rmcup=\E[2J\E[?47l\E8,
              smcup=\E7\E[?47h

For 'standard' xterm: smcup saves the cursor and switches to the alternate
screen buffer; rmcup clears the screen, returns to the normal screen buffer
and restores the cursor position.

  xterm       rmcup=\E[?1049l
              smcup=\E[?1049h

The 1049 sequence is a XFree addition which our xterm doesn't appear to
support. Our current gnome-terminal (snv_65) does support this sequence.

  xtermc      rmcup=\E@0\E[?4r
              smcup=\E@0\E[?4s\E[?4h\E@1

This is as broken as our definition.

Our xterm, xtermc and xterm-color smcup/rmcup definitions need updating
to work on the standard Solaris xterm and gnome-terminal.
Work Around
1. mkdir $HOME/terminfo
2. TERM=xterm infocmp > xterm.src
3. Edit xterm.src and add/change rmcup and smcup:
   rmcup=\E[2J\E[?47l\E8, smcup=\E7\E[?47h,
4. TERMINFO=$HOME/terminfo tic xterm.src
5. TERMINFO=$HOME/terminfo TERM=xterm xterm
Comments
N/A