Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!noao!asuvax!mcdphx!hrc!dan From: dan@hrc.UUCP (Dan Troxel) Newsgroups: comp.databases Subject: Accell 1.3 & Unify 4.0 ( how do they set the i/o when going to vi? ) Message-ID: <198069@hrc.UUCP> Date: 27 Feb 89 20:44:22 GMT Organization: Handwriting Research Corp. - Phoenix, AZ Lines: 80 What routine is Accell 1.3 using when executing the vi for editing .fs scripts? The reason for the question, is I have need to run shell scripts from Accell, and the $push_shell() function, only executes /bin/sh, not a user selectable program. I have hacked, (and I mean hacked), a function call that remembers what the terminal i/o of Accell requires, and 'stty sane' s the terminal when calling the script. The problem is, when calling programs such as 'vi', when called, it barfs. ( sorry to be grafic, but that is how I feel ). Any ideas? ---------------------------cut here------------------------------------------ /******************************************************************************* * * * When calling a shell program, it is good to set the terminal io to sane mode * * by a 'stty sane'. This will allow for normal screen io, that most users * * are accustomed to. Use push_shell$() if you wish to get a shell prompt. * * * * Follow the Accell manual instructions in creating the call to be linked into * * the manager. If you have any questions, please feel free to call me. * * Dan Troxel @ HRC in Phoenix, AZ (602) 957-8870 * * * * * * One thing that should be done, is resetting ALL of the ioctl and signal * * calls, so that any program can be run by call_system. ie: vi does not * * run correctly. * * * *******************************************************************************/ #include #include "chookincl.h" #include #include struct termio tsav,tchg; call_system(argc,argv) int argc; AVAL *argv; { char *p,buf[120]; int c; reset(1); /* saves terminal io specs for accell */ p=argv[0].aval.stval; /* struct where call args are found */ usystem(p); /* undocumented UNIFY call */ reset(0); /* resets terminal specs for accell */ return; } reset(n) int n; { if(n==1 && ioctl(0,TCGETA,&tsav)==-1) { perror("Can't get original settings"); exit(1); } if(n==0 && ioctl(0,TCSETA,&tsav)==-1) { perror("Can't reset original settings"); exit(3); } } ----------------------------cut here----------------------------------------- -- Dan Troxel @ Handwriting Research Corporation WK 1-602-957-8870 Camelback Corporate Center 2821 E. Camelback Road Suite 600 Phoenix, AZ 85016 ncar!noao!asuvax!hrc!dan hrc!dan@asuvax.asu.edu