[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: LucasJA
Subject: Re: ncurses bugs the output of the program I call
Date: Fri, 16 Sep 2011 16:22:52 -0700 (PDT)

Grant Edwards-6 wrote:
> 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?
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-ncurses

Actually I don't collect the output of ps. I let the called program to
output on the screen for me, but it is outputting all messed up (as above)
View this message in context: 
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.

reply via email to

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