[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: curses issue

From: Thomas Dickey
Subject: Re: curses issue
Date: Wed, 24 Feb 2010 20:45:54 -0500 (EST)

On Thu, 25 Feb 2010, Ahmed Raafat wrote:

Im a unix student, and i'm having a problem understanding the usage of curses c-class of functions. I'm trying to incorporate them in a shell i'm creating inorder to be able to display the time on the shell constantly on the top right hand corner. Im trying to fork a process that displays the time and run in the background and refreshes every 3 secs to write the time and return the cursor to the shell initial position.Is there any help that u can provide in helping me achieve this.

curses as such doesn't do _that_, since it operates on either the whole
screen, or on a single line.

Instead, you could use the lower-level terminfo calls to do some of this
(move the cursor, write text using the terminal capabilities that make
it bold, colored or whatever you need).  But there's a part that isn't
in either - determining where the cursor was orginally on the screen.
That could be done as in the resize program (bundled with xterm), which
reads the vt100-style cursor position report.

Even with those, you'd still be limited to working with relatively
static shell prompts (even when flushing I/O) since interrupting another
program that sends escape sequences to the terminal, such as a text editor
would make occasional messes on the screen.

That's all doable - enjoy...

Thomas E. Dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]