For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > March 2008 > Turning cursor off









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Turning cursor off
k.miles631@btinternet.com

2008-03-25, 7:25 pm

Could someone please tell me how to turn the cursor off in a C programme for
Unix.
Regards, Kenneth.
Edward Rosten

2008-03-25, 7:25 pm

On Mar 25, 9:29 am, k.miles...@btinternet.com wrote:
> Could someone please tell me how to turn the cursor off in a C programme for
> Unix.
> Regards, Kenneth.



you need to printf the control sequence:

^[[?25l

or "h" instead of "l" to switch it back on.

^[ stands for escape.

A more complete list is here: http://www.xfree86.org/current/ctlseqs.html

-Ed
--
(You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)

/d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1
r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12
d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage
k.miles631@btinternet.com

2008-03-25, 7:25 pm

Edward Rosten wrote:

> On Mar 25, 9:29 am, k.miles...@btinternet.com wrote:
>
>
> you need to printf the control sequence:
>
> ^[[?25l
>
> or "h" instead of "l" to switch it back on.
>
> ^[ stands for escape.
>
> A more complete list is here: http://www.xfree86.org/current/ctlseqs.html
>
> -Ed
> --
> (You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)
>
> /d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1
> r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12
> d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage


Thank you for your quick reply, I have been searching all day for the answer
to this.
Regards, Kenneth.
Gordon Burditt

2008-03-25, 7:25 pm

>Could someone please tell me how to turn the cursor off in a C programme for
>Unix.
>Regards, Kenneth.


There is no one character sequence to do this. All the world is
not a vt100-compatible terminal or terminal emulator. There are
reasons for variables like $TERM, and packages like termcap, terminfo,
and curses.

Some terminals do not have a cursor to turn off (printing terminals
with no CRT tend to do this). Some terminal emulations are just
stupid (I think the MS-DOS console without ANSI.SYS leaves out a
lot of stuff. And yes, you can telnet from MS-DOS to UNIX with
appropriate drivers and network hardware.)

Thomas Dickey

2008-03-27, 7:28 pm

Gordon Burditt <gordonb.vqyzd@burditt.org> wrote:
[color=darkred]
> There is no one character sequence to do this. All the world is
> not a vt100-compatible terminal or terminal emulator. There are
> reasons for variables like $TERM, and packages like termcap, terminfo,
> and curses.


> Some terminals do not have a cursor to turn off (printing terminals
> with no CRT tend to do this). Some terminal emulations are just
> stupid (I think the MS-DOS console without ANSI.SYS leaves out a
> lot of stuff. And yes, you can telnet from MS-DOS to UNIX with
> appropriate drivers and network hardware.)


fwiw, VT100's cannot turn the cursor off.

In the line of DEC terminals, that feature was added several years later in
the VT300 series (noting that most of the terminals which provide this
feature do not emulate a VT300, either ;-)

The VT300 sequence in turn is not an ANSI sequence
(it's a DEC private mode setting).

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com