[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
endwin, and temporarily leaving curses mode
From: |
Mike Mueller |
Subject: |
endwin, and temporarily leaving curses mode |
Date: |
Fri, 21 Apr 2006 12:24:54 -0400 |
I'm working on a program which spends all its time in
curses/raw/noecho mode. Recently I started working on a feature that
lets users drop out to a shell temporarily. This seems to be a common
thing to do, and the answer in the docs is endwin() before the shell,
and refresh() after, as seen here:
http://www.roseindia.net/linux/tutorial/linux-howto/NCURSES-Programming-HOWTO/misc.html#TEMPLEAVE
However, I run endwin(), then invoke the shell (via system()) and the
result is somewhat correct, but not completely. The shell displays a
normal prompt, but typed characters are not echoed back to the
terminal. 'ls' displays things in neat columns, so it seems like
we're in a semi-cooked mode. Finally, when the user exits the shell,
I prompt "press enter to continue" and call fgets() to wait for that
'enter' before anything else happens. Unfortunately, hitting enter
(or ^M) doesn't do anything at this prompt. Hitting ^J, on the other
hand, does work.
When I call refresh(), curses is back to normal and my app is working
fine. So the problem is only in the endwin-shell part of the process.
Any tips?
Thanks!
Mike
- endwin, and temporarily leaving curses mode,
Mike Mueller <=