[comp.os.vms] Command procedure input

ejnorman@uwmacc.UUCP (Eric Norman) (07/03/87)

We have Eunice here.  One of the things you can do is define
the Eunice commands as foreign commands so that they can be
used directly from VMS, e.g.

  vi :== $eun_root:[usr.ucb]vi vi

This works fine; vi manages to do whatever is necessary to
read characters one at a time from the terminal.  However,
if I try to do it with a command procedure, e.g.

  $ vi := $eun_root:[usr.ucb]vi vi
  $ define/user_mode sys$input sys$command
  $ vi 'P1'
  $ exit

the terminal gets in the mode where nothing happens until
you whang the CR key.  I can get the terminal in what Eunice
(and Unix) calls "raw" mode by doing the Eunice "stty raw"
command first, but it's too raw; line-feeds sent by Eunice
don't get translated to carriage-return line-feeds.

The only way I've found that seems to work is to spawn the
blighter, e.g.

  $ vi := $eun_root:[usr.ucb]vi vi
  $ spawn/nolog vi 'P1'
  $ exit

Note, that this isn't just Eunice's vi; anything from Eunice
that wants the terminal in raw mode seems to work this way.
Evidently Eunice isn't doing something that EDT knows how
to do.

Anyway, the first thing I'd like to know is if there's anthing
I can do in a command procedure so that the terminal will end
up in the right mode.  If that's not possible, what do I need
to do in the code for the command so that I can execute it
from a command procedure?

Thanks,

Eric Norman
Internet:     ejnorman@unix2.macc.wisc.edu
UUCP:         ...{allegra,ihnp4,seismo}!uwvax!uwmacc!ejnorman
Life:         Detroit!Alexandria!Omaha!Indianapolis!Madison!Hyde
  
"Holy cosmos."			-- Robin
"It's a big order, Robin."	-- Batman
--

Peck@RADC-MULTICS.ARPA (Rodney) (07/04/87)

  Well, I went thru this exact problem a week ago.  To get the programs
to accept input from a terminal when executed from a batch job, you have
to redefine sys$input in user_mode.  The following works real dandy:

 $define/user_mode sys$input tt:
 $ edit/tpu myfile

   I think your problem is that sys$command is munged in com files too.
I'm fairly certain that tt:  is always the i/o terminal associated with
the process.
   -rodney
 PS:  The rawo of multics/unix has extremely little to do with the
problem.

kenw@noah.arc.CDN (Ken Wallewein) (07/06/87)

When executing programs which want direct access to the terminal (like EDT),
I find that the best approach it to
  $DEASSIGN SYS$INPUT
Try it. It's simple, and it works.
/kenw
                                                                 A L B E R T A
Ken Wallewein                                                  R E S E A R C H
                                                                 C O U N C I L

heisterb@uiucuxe.UUCP (07/09/87)

[ Limbo 'till your spine cracks!  Then limbo some more. ]

If you throw in a DEASSIGN sys$input you should be okay.  Eg.:

    $ vi :== vi_definition
    $ DEASSIGN sys$input
    $ vi 'P1'
    $ other stuff

The DEASSIGN only lasts for the duration of the next image, in this case
vi.  This works for telnet as well.  Don't ask me why.  I think I know but
I'm sure I'd embarrass myself horribly trying to explain it.  I suppose that
telnet, vi, and other WG software demand that their input come from
sys$command or from a real TT.  That's probably the crux of the biscuit.

heisterb@uxe.uiuc.cso.edu