[comp.unix.programmer] Turning off the curser.

david@talgras.UUCP (David Hoopes) (12/12/90)

Hello netland,

Can anyone tell me now to turn off the curser so that it does not
show up on the screen.

This is on Sys V 386 using curses.  I have a nice menu but the blinking
curser makes it look messy.


thanks in advance.


-- 
------------------------------------------------------------------------
David Hoopes                              Tallgras Technologies Inc. 
uunet!talgras!david                       11100 W 82nd St.          
Voice: (913) 492-6002 x323                Lenexa, Ks  66214        

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (12/13/90)

In article <21@talgras.UUCP> david@talgras.UUCP (David Hoopes) writes:

| Can anyone tell me now to turn off the curser so that it does not
| show up on the screen.
| 
| This is on Sys V 386 using curses.  I have a nice menu but the blinking
| curser makes it look messy.

  ANSI escapes:

	\033[=12;10C	# cursor off
	\033[=10;12C	# cursor on
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me

jellis@vicstoy.UUCP (Jacob Ellis) (12/14/90)

In article <21@talgras.UUCP> david@talgras.UUCP (David Hoopes) writes:
>Hello netland,
>
>Can anyone tell me now to turn off the curser so that it does not
>show up on the screen.
>
>This is on Sys V 386 using curses.  I have a nice menu but the blinking
>curser makes it look messy.

The blinking cursor is really dependent on your terminal's capabilities
(ie. it may not support turning the cursor off). Anyway, if it can be done
the function curs_set() in curs_kernel(3X) will do the trick.

>David Hoopes                              Tallgras Technologies Inc. 
>uunet!talgras!david                       11100 W 82nd St.          
>Voice: (913) 492-6002 x323                Lenexa, Ks  66214        


-- 
Jacob Ellis  --  jellis@vicstoy.UUCP  --  Any opinions expressed above are mine

jim@segue.segue.com (Jim Balter) (12/16/90)

>In article <21@talgras.UUCP> david@talgras.UUCP (David Hoopes) writes:
> Can anyone tell me now to turn off the curser so that it does not
> show up on the screen.
> 
> This is on Sys V 386 using curses.  I have a nice menu but the blinking
> curser makes it look messy.

Why is it necessary to litter the net with questions that are trivially
answered by Reading The F*cking Manual?  The term RTFM is supposed to instill
in people a sense of great shame and personal failure when they fail to obey
it.  This is not only to reduce net litter, but also because people who don't
read the manual are bad programmers who make many undetected mistakes, and some
of them might be designing weapons systems or something.  Yikes.

So, you can turn off the curser by RTFM.  But if you want to know how to
turn off the *cursor*, according to the System V/386 Release 3.2 Programmer's
Reference Manual, article CURSES(3X), page 27, you will find that curs_set(0)
will make the cursor disappear if the terminal supports it.  Due to a printing
error, the error code if the terminal doesn't support it is omitted, but
consistency and experimentation indicates that it is ERR.  Here's some code I
use:


	if ( curs_set(0) != ERR )	/* try to make cursor invisible */
		leaveok(stdscr, TRUE);	/* don't care where curses leaves it */
	...


	move(LINES-1, COLS-1);  /* in case the cursor isn't invisible,
				   put it out of the way */
	refresh();


In article <2600@sixhub.UUCP> davidsen@sixhub.UUCP (bill davidsen) writes:
>
>  ANSI escapes:
>
>	\033[=12;10C	# cursor off
>	\033[=10;12C	# cursor on

First, the guy asked about curses, so this info isn't directly useful to him.
Second, these sequences only work with the console drivers of certain versions
of certain operating systems; they are not generally available.  Third, your
cursor on sequence is actually making the cursor occupy scan lines 10-12, which
may or may not be aesthetically pleasing, and may not show the cursor at all if
you aren't in 25-line mode (e.g., it won't work with stty ENH_C80x43 on
386/ix 2.2 (don't try this command on other systems!)).

But, if you really want to use these sequences with your console driver and
curses, set the civis and cnorm capabilities in your terminfo entry.
For details, RTFM.  Given the number of broken terminfo entries distributed
with the system, this will put you into a select minority.


"People with lives don't read UseNet."

wmark@wb3ffv.ampr.org (Mark Winsor) (12/17/90)

> | This is on Sys V 386 using curses.  I have a nice menu but the blinking
> | curser makes it look messy.
> 
>   ANSI escapes:
> 
> 	\033[=12;10C	# cursor off
> 	\033[=10;12C	# cursor on

Use curs_set(0) for sys5.3 (Can't vouch for others. 0 turns off the curser
1 turns it to normal, and 2 turns it super-visible).

Mark S. Winsor
Systems Analyst
ProVAR, Inc.