|
From: | Thomas Dickey |
Subject: | Re: ncurses bugs the output of the program I call |
Date: | Fri, 16 Sep 2011 19:37:10 -0400 (EDT) |
On Fri, 16 Sep 2011, LucasJA wrote:
Thomas Dickey-2 wrote:On Thu, 15 Sep 2011, LucasJA wrote:Hello. I am developing a shell as a homework and I am using ncurses. I setup the ncurses for my shell. When I call the 'ps' program from my shell, it outputs the result incorrectly on the screen:You're probably not calling one of the functions which is used to temporarily restore the terminal modes before invoking 'ps'. For example, endwin (before) and refresh (after).
...
If I temporarily leave the ncurses mode, call the 'ps' and return to ncurses mode (using endwin() then refresh()), the output of the ps is not shown on my shell, it is shown in the gnome-terminal (I can see the output after I close my shell program). I would like to see the output of it on my program. What can I do? Thanks.
The usual way to solve that problem is to use a pipe (using popen) for collecting the output of the "ps" (or whatever) program, and use ncurses to write the data to the screen.
-- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net
[Prev in Thread] | Current Thread | [Next in Thread] |