[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ncurses bugs the output of the program I call
From: |
Grant Edwards |
Subject: |
Re: ncurses bugs the output of the program I call |
Date: |
Fri, 16 Sep 2011 13:50:06 +0000 (UTC) |
User-agent: |
slrn/pre0.9.9-102 (Linux) |
On 2011-09-16, LucasJA <address@hidden> wrote:
> Thomas Dickey-2 wrote:
>> On Thu, 15 Sep 2011, LucasJA wrote:
>>
>>> 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.
So you're collecting the output of ps in your program and then writing
it to the screen? It appears that curses doesn't do automatic
LF->CR/LF conversion on the strings you write to the screen. Have you
tried inserting a CR before each LF when you write the output?
--
Grant Edwards grant.b.edwards Yow! ... or were you
at driving the PONTIAC that
gmail.com HONKED at me in MIAMI last
Tuesday?