Xref: utzoo comp.unix.questions:16464 comp.unix.wizards:18278 Path: utzoo!attcan!utgpu!watmath!att!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!gem.mps.ohio-state.edu!apple!ames!mailrus!uflorida!novavax!augusta!rcostell From: rcostell@augusta.UUCP (Roger Costello) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Putting a curses program in the background then in the foreground Keywords: curses Message-ID: <4013@augusta.UUCP> Date: 21 Sep 89 11:58:15 GMT Organization: Gould CSD, Fort Lauderdale, FL Lines: 16 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