Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gladys.UUCP Path: utzoo!watmath!clyde!burl!gladys!dalton From: dalton@gladys.UUCP (David Dalton) Newsgroups: net.micro.att Subject: UNIX PC 7300: Invoking user agent with a command Message-ID: <254@gladys.UUCP> Date: Fri, 14-Feb-86 16:11:03 EST Article-I.D.: gladys.254 Posted: Fri Feb 14 16:11:03 1986 Date-Received: Sun, 16-Feb-86 03:57:07 EST Organization: SFWN at Tobaccoville, NC Lines: 84 I already received a couple of inquiries, so I decided to go ahead and post this instead of using mail. USING BVI.C TO GET INVOKE THE USER AGENT AS A COMMAND Here's the bvi.c program. Its intended use is to create a new default editor for the user agent -- bvi. The program opens a full 80x24 window (install of the smaller window that the user agent normally uses) and runs vi in it. The bvi.c program can also be used for other purposes. It will open an 80x24 window for ANY program, then restore the screen when you exit. If, for example, you change /usr/bin/vi (it appears twice in the program) to /usr/bin/ua, you can call the user agent from a non-user-agent login. The program will open a full-screen "window," then run the user agent. When you log out of the user agent, you'll be back in shell with your screen restored. You'll have quick access to the user agent, even though you prefer using the 7300 as a plain UNIX machine. Remember: Shift-F2 will invoke the call screen anyway, without the help of the bvi.c program. Repertory dialing also works fine from a non-user-agent login. You will get a black background, not a dotted background. This is normal. If you're using the 2.0 system software, you may want to clear the screen before you invoke the user agent. The initial Office window may not clear the background. A WARNING: If you are using the Korn shell, it keeps a history file -- .history in $HOME. This is the same file name that the user agent uses for your telephone call history. If the Korn shell clobbers your .history file, it will be fatal to the phone daemon if you invoke the history function, since apparently no checking is done for corruption of .history. The cure is easy: In your .profile, change the Korn shell's HISTFILE default to something else, like .khistory, and be sure to export it. That will keep the two files from corrupting each other. ANOTHER WARNING: Michael Eldridge wrote a nice enhancement for bvi.c which may not work if you want to use it to invoke the user agent from shell. His modifications check to see if you're already in a window. If you're not, it doesn't bother to open a window. The version of bvi.c that appears below is the one I use. Here's a copy of the bvi.c program, which moved on the net a while back, in case some of you can't find it: --------------------------------------------------------------------------- /* * BVI -- On an AT&T Unix-PC, run vi in a new 24x80 borderless window. * * This program will open a borderless (80 column) window on top of all * your other windows and run vi in it. When vi exits, the window * will be removed, revealing the window in which you typed bvi unchanged. * * Usage: bvi args-to-vi * * Author: Corey Satten, fluke!corey Sept 1985 * * This software is hereby officially introduced into the public domain. */ main(ac,av,ep) int ac; char *av[], *ep[]; { int fd, i; char *termcap; fd = open("/dev/window",2); close(0); dup(fd); close(1); dup(fd); close(2); dup(fd); av[0] = "/usr/bin/vi"; for (i=0; ep[i]; ++i) { if (!strncmp(ep[i],"TERMCAP=",8)) { ep[i] = "TERMCAP=/etc/termcap"; } if (!strncmp(ep[i],"TERM=",5)) { ep[i] = "TERM=s4"; } } av[0] = "/usr/bin/vi"; execve("/usr/bin/vi", av, ep); }