[MPlayer-dev-eng] turning cursor off on fbdev/matroxfb/etc

Attila Kinali kinali at gmx.net
Sun Oct 28 11:59:29 CET 2001


On Thu, 25 Oct 2001 00:55:59 +0200 Gabucino <gabucino at mplayer.dev.hu> wrote:

> It's the Question that drives us, Felix Buenemann :
> > On Wednesday, 24. October 2001 20:22, Gabucino wrote:
> > > echo -e '\033[?25l'
> > do you also have escape sequence to turn it back on?
> But of course!
> 
> echo -e '\033[?25h'

I wouldnt use escape sequenzes as i'm not sure whether they
are portable. A better way is IMHO to do it like setterm:


---schnipp1---
static char *ti_entry(const char *name) {
        /* name: Terminfo capability string to lookup. */

/* Return the specified terminfo string, or an empty string if no such terminfo
 * capability exists.
 */

        char *buf_ptr;

        if ((buf_ptr = tigetstr(name)) == (char *)-1) buf_ptr = NULL;
        return buf_ptr;
}
---schnapp1---

---schnipp2---
        /* -cursor [on|off]. */
        if (opt_cursor) {
                if (opt_cu_on)
                        putp(ti_entry("cnorm"));
                else
                        putp(ti_entry("civis"));
        }
---schnapp2---

putp and tigetstr are in /usr/include/term.h resp libncurses


		Attila Kinali

-- 
"Though a program be but three lines long,
someday it will have to be maintained."
-- The Tao of Programming



More information about the MPlayer-dev-eng mailing list