Turning off the curser.

Jim Balter jim at segue.segue.com
Sun Dec 16 07:53:26 AEST 1990


>In article <21 at talgras.UUCP> david at 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 at sixhub.UUCP> davidsen at 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."



More information about the Comp.unix.programmer mailing list