Putting a curses program in the background then in the foreground
Roger Costello
rcostell at augusta.UUCP
Thu Sep 21 21:58:15 AEST 1989
I have a question concerning putting a curses program in the
background (with ^Z) and then at a later time putting it in the
foreground (with fg). I have found that when I put the program
back into the foreground I am back in cbreakmode and in nonecho
mode. How do I get the program back into the state it was in
before sending it to the background? Secondly, when I do bring
the program to the foreground I have observed that the screen is
redrawn. How is this being accomplished?
As to the later question, I am guessing that when the program is
brought to the foreground the system (somehow knows to) call the
curses refresh routine passing to it curscr. Is this correct? If
so, then perhaps the solution to the first question is to modify
the curses refresh routine such that it checks for curscr as the
parameter and if curscr is the parameter then it resets the state,
i.e. sets raw mode and echo mode. Sound reasonable?
Thanks for any help you may be able to provide. /Roger
More information about the Comp.unix.questions
mailing list