[comp.databases] Accell 1.3 & Unify 4.0

dan@hrc.UUCP (Dan Troxel) (02/28/89)

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 <stdio.h>
#include "chookincl.h"
#include <ctype.h>
#include <termio.h>

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

allbery@ncoast.ORG (Brandon S. Allbery) (03/11/89)

As quoted from <198125@hrc.UUCP> by dan@hrc.UUCP (Dan Troxel):
+---------------
| In article <85@dsinc.UUCP>, syd@dsinc.UUCP (Syd Weinstein) writes:
| > In article <198069@hrc.UUCP> dan@hrc.UUCP (Dan Troxel) writes:
| > >
| > >What routine is Accell 1.3 using when executing the vi for editing .fs scripts?
| > The problem is more basic than that.  Accell, or Unify, for that
| > matter don't pass stderr to the child process.  Vi does its terminal
| I received this suggestion from many netters. It worked! I wrote a 'C' hook
+---------------

Yes, it works!  Thanks from the bottom of my heart for this!!!

Now for another similar, annoying problem:

I use csh as my shell (one of those old csh's from the PDP-11, pre-job
control, under System V).  When I shell out from Accell via push_shell$() or
selecting the menu option from the Development Environment, it prints a
prompt but doesn't maintain history; i.e. it's only *partially* interactive.
Adding a wrapper to the shell-out sequence (I save the original value of
$SHELL in $ACLENV_SHELL and set $SHELL to a program which repairs stderr and
execs $ACLENV_SHELL) does NOT fix this.  Any ideas?

++Brandon
(P.S.  I hope to be posting my modifications to the Accell text field hooks
posted last year in c.s.misc shortly.  I've made mucho fixes to the C hooks
and the editor, made the editor much more Accell-like, and added a new hook
for displaying multiple lines from a TEXT field in multiple Accell screen
variables.  If I can figure out how to do it sensibly, I may add the ability
to scroll the multiple-line version; right now it displays what it can and
adds ellipses at the end of lines and "[More]" on the bottom line when it
can't fit it all.)
-- 
Brandon S. Allbery, moderator of comp.sources.misc	     allbery@ncoast.org
uunet!hal.cwru.edu!ncoast!allbery		    ncoast!allbery@hal.cwru.edu
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>
NCoast Public Access UN*X - (216) 781-6201, 300/1200/2400 baud, login: makeuser