[Techtalk] Evil alternate screens in gnome-terminal

Akkana Peck akkana at shallowsky.com
Fri Mar 26 18:55:18 EST 2004


I was fiddling with gnome-terminal today trying to solve a mutt
utf8 problem (long story), and was whining about gnome-terminal's
evil mandatory alternate screens.  That's where you're reading a
man page, say, and you get to the place that describes exactly
what you were looking for, and you hit q so that you can try out
the command on the man page .-- and the man page vanishes and all
you see are the last few commands you typed.  The same problem makes
it impossible to read the last page of any man entry, since that
screen goes away if you don't have less prompt you.

This used to be an optional feature in xterm clones
(XTerm*titeInhibit: true) but it has become mandatory in the
"New, less configurable" linux world.  A couple of other people
also expressed frustration over this.

I remembered reading once a suggestion to try XTERM=linux.
That didn't work well (there are differences in the two terminals,
so I got occasional garbage on the screen) so I figured out how to
make my own terminfo entry.  I based it on xterm-color,
not the base xterm entry.

Take this entry, save it as xterm-noalt.terminfo, and do this with it:
  tic -o ~/.terminfo xterm-noalt.terminfo
(you might have to mkdir ~/.terminfo first)
then set TERM=xterm-noalt (and export as necessary, I use setenv :-)
and the evil alternate screens coming out of vim or man should
cease to occur.

(Thanks to peterS for pointing me to infocmp and tic!)

#       Reconstructed via infocmp from file: /etc/terminfo/x/xterm-color
#       Edited by akkana to remove evil rmcup stuff.
xterm-noalt|color xterm with no alternate screen (X Window System), 
        am, km, mir, msgr, xenl, 
        colors#8, cols#80, it#8, lines#24, ncv@, pairs#64, 
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 
        bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M, 
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
        dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, 
        el=\E[K, enacs=\E)0, home=\E[H, ht=^I, il=\E[%p1%dL, 
        il1=\E[L, ind=^J, 
        is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, kbs=^H, 
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\177, 
        kend=\E[4~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, 
        kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, 
        kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, 
        kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, 
        kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 
        khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
        op=\E[m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 
        .rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, 
        rmso=\E[m, rmul=\E[m, 
        rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, sc=\E7, 
        setab=\E[4%p1%dm, setaf=\E[3%p1%dm, sgr0=\E[m, smacs=^N, 
        .smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m, 
        smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, 
        u8=\E[?1;2c, u9=\E[c, 

Hope this helps somebody!
Now if only I could figure out how to get Page Up to page up,
without hacking the source  ...

	...Akkana


More information about the Techtalk mailing list