[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Leaving display visible when exiting ncurses application
From: |
Thomas Dickey |
Subject: |
Re: Leaving display visible when exiting ncurses application |
Date: |
Mon, 11 Jan 2010 18:17:04 -0500 (EST) |
On Tue, 12 Jan 2010, Allistar wrote:
Hi all,
I have developed a brute-force puzzle breaking application for a board
puzzle (called Kaleidoscope). This can take many hundreds of thousands of
iterations, and the output of the current "solution" is displayed using
ncurses (the board is output at a particular location on the screen, so the
user sees it animating as the algorithm progresses).
The problem is that when the application finishes, the screen is cleared
and I am left back at the terminal prompt. I would like it so the contents
from the ncurses window are displayed to the normal console when the
application exits. Is there a way to do this?
That sounds like you want to override the switching between xterm's
normal/alternate screens.
dialog does this - relies on knowing how ncurses works, i.e., that the
data declared in term.h _is_ the same as used by the curses library, so
it's not portable to other implementations. Look at init_dialog() in
util.c
http://invisible-island.net/dialog/
Also I would like this to happen if the application is killed ungracefully
(ctrl-c).
Given the above workaround, this would work reasonably well also...
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net