Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement
Linux 2.0 Unofficial Patches (20-big-cursor.patch)

Linux console BIG cursor & contents saving/restoring

Sergey Korshunoff (Sergey_Korshunoff@p5.f434.n5020.z2.fidonet.org)
Mon Feb 10 20:50:00 1997

[Home] [Linux 2.0] [Linux 2.1] [Information] [Distributions] [Links]

20-big-cursor.patch
Hello! There is a linux-2.0.18 console patch for big cursor and screen contents saving support. Sorry for posting to news group but I can not send it to mail list (broken e-mail link). It is not so big.

Escape sequence for big cursor on/off I choose like for

        AT&T 610; 80 column; 98key keyboard
        AT&T 620; 80 column; 98key keyboard
        AT&T 730 windowing terminal

Normal    cursor \E[?25h\E[?12l ( \E[?12l added )
Big       cursor \E[?25h\E[?12h ( \E[?12h added )
Invisble  cursor \E[?25l        ( not changed )

Save contents is like for xterm - \E[?47h for save console contents and \E[?47l for restoring.

You need to change console type from "linux" to "linux2" in /etc/inittab like

        1:1234:respawn:/sbin/getty tty1 VC linux2
        2:234:respawn:/sbin/getty tty2 VC linux2

or set "TERM=linux2" in /etc/profile.

"vi", "crisp", SLang curses based games now restore contents on exit without recompilation. NCURSES 1.9.9e has bug wich don't allow application to get strings for "smcup", "rmcup" (this may be my fault, but I can not make ncurses return non zero for this values). If You recompile "wpe" with TERMCAP or modify it not to search terminfo but use default ones, then "wpe" will allow You to see user program screen when debuging on console.

There is no big cursor patch for tga.c (only vga.c). You are welcome to write one.

Cost for console contents saving -- there may be two screen buffers for virtual console if curses based program don't switch back on exit. But

          for t in $SCREENS
          do
                echo -n -e "\\033[?47l" > /dev/$t
          done

bash script would free all screen saver buffers in this case. As I say -- ncurses 1.9.9e based programs can't use this feature, and Slang curses library is safe.

No kernel memory wasted when You don't run curses based programs.

Regards, Sergey Ya. Korshunoff p5.f434.n5020.z2.fidonet.org

PS: this work even on telnet sessions. Midnight Commander can throw away SUID "cons.saver" and don't more say

        Not an xterm or Linux console
        the panels cannot be toggled.

But MC has strange detection of color terminals. You need add enviroment variable COLORTERM or call as "mc -c" to get colors back with linux2.

PPS: no cursor visibility is saved by save cursor sequence. I added \E[?25h to xterm rmcup sequence.

+-----0<-----------------------------0<----------------------
# new termcap entry for linux console with big cursor and
# screen contents saving support.

linux2:\
        :vi=\E[?25l:ve=\E[?25h\E[?12l:vs=\E[?25h\E[?12h:\
        :ti=\E7\E[?47h:te=\E[2J\E[?47l\E8\E[?25h:\
        :tc=linux:

+-----0<-----------------------------0<----------------------
# new terminfo entry for linux console with big cursor and
# screen contents saving support.

linux2|linux with big cursor and console contents saving support,
        cnorm=\E[?25h\E[?12l, cvvis=\E[?25;12h,
        smcup=\E7\E[?47h, rmcup=\E[2J\E[?47l\E8\E[?25h, use=linux,
+-----0<-----------------------------0<----------------------




[Home] [Up] [Search] [FeedBack]


For information regarding copying and distribution of this material see the COPYING document.
Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.