system()'ing a curses app from a curses app

system()'ing a curses app from a curses app

Post by pete » Wed, 07 Dec 1994 08:00:35



Hi,

Our curses application on SCO unix needs to system() an editor.

When I start up vi, it comes up in a weird mode where the lines
in the text file don't begin at the left margin, but begin where
the previous one left off. No "backslash R" type stuff.

When I start up MicroEmacs it works fine.

However, when I quit the editor the screen is not updated and sometimes
the char set turns egyptian.

Do I need to somehow save & restore the curses screen and settings?
Is there a way to do this with curses?

Our app is just plan ANSI C compiled with gcc.

best regards,
P. Meulmeester

 
 
 

system()'ing a curses app from a curses app

Post by Michael Bresnah » Thu, 08 Dec 1994 02:20:03



>Hi,

>Our curses application on SCO unix needs to system() an editor.

>When I start up vi, it comes up in a weird mode where the lines
>in the text file don't begin at the left margin, but begin where
>the previous one left off. No "backslash R" type stuff.

>When I start up MicroEmacs it works fine.

>However, when I quit the editor the screen is not updated and sometimes
>the char set turns egyptian.

>Do I need to somehow save & restore the curses screen and settings?
>Is there a way to do this with curses?

>Our app is just plan ANSI C compiled with gcc.

Yes, you have to save the current curses state, restore the normal
state, exec vi, return from vi, restore curses state.  I've never
actually done it, but I know there is stuff in the man page about it.
There are some lib functions to save and restore the state for doing
exactly what you're describing.

Hope this helps.

MikeB

 
 
 

system()'ing a curses app from a curses app

Post by S J Sobol - Marketing/Tech Suppo » Thu, 08 Dec 1994 05:43:40


: Yes, you have to save the current curses state, restore the normal
: state, exec vi, return from vi, restore curses state.  I've never
: actually done it, but I know there is stuff in the man page about it.
: There are some lib functions to save and restore the state for doing
: exactly what you're describing.

try:

endwin();
system("whatever");
doupdate();

--

DOS/Windows/Unix Hack(er) and CEO of The Tiny Software Company
Marketing and Tech Support Person for APK Internet Services
and all-around Nice Guy(tm) :)    IRC: Hopeless or PearlJam or StevenJ

 
 
 

system()'ing a curses app from a curses app

Post by Dan Merc » Fri, 09 Dec 1994 04:10:41


: Hi,

: Our curses application on SCO unix needs to system() an editor.

: When I start up vi, it comes up in a weird mode where the lines
: in the text file don't begin at the left margin, but begin where
: the previous one left off. No "backslash R" type stuff.

: When I start up MicroEmacs it works fine.

: However, when I quit the editor the screen is not updated and sometimes
: the char set turns egyptian.

: Do I need to somehow save & restore the curses screen and settings?
: Is there a way to do this with curses?

: Our app is just plan ANSI C compiled with gcc.

: best regards,
: P. Meulmeester
You are in raw mode in curses,  you need to be cooked.  Do a :
savetty();        /* save current setting */
resetterm();      /* Set tty modes to "out of curses" state */
system(vicmd);
resetty();        /* Reset tty flags to stored value */

--
Dan Mercer                                            ClearSystems, Inc

======================================================================
All opinions expressed are my own and do not reflect the opinions of
my employer or my employer's clients,  in particular 3M Company.
All advice or software offered or presented is provided As Is with no
warranty either expressed or implied.  Follow at your own risk.
Objects in the mirror are closer than they appear.

 
 
 

1. : Calling Non-Curses Apps from Curses App ?

I know this has been discussed.  Can someone let me know how to call non
curses applications (like more and vi) from my curses application,
without strange terminal characteristics ocurring in the shell, or when
I return, or loosing my last curses screens.

Thanks Greatly

Tom Lane

2. SSL Secure Socket Layer.

3. How to link 'curses' app ?

4. Berkeley Packet Filter (BPF) for Solaris2.3

5. curses curses curses

6. Redirecting X-Display SUN -> VAX

7. CURSES QUESTION: how do you 'shell' from curses?

8. Color Graphics Display Adapter (GDA)

9. Running a shell script from a curses app?

10. debugging curses apps with gdb

11. HELP: getting COLOR text in CUrses app on SUN

12. gdb and curses apps

13. curses app sought