[comp.sys.apollo] Prompt and EC2_WAIT

firby-james@YALE.ARPA (James Firby) (02/22/88)

Okay, I give up.  I've been trying every way I can think of to do the
following simple thing:  I want to print a prompt to an aegis shell
standard output (ie. IOS_$STDOUT) so that it shows up in the shell input
widnow and then WAIT until either a line is typed in, or a GPR event occurs.
I can't find any way to do this right.

Here is what I've tried:

Method 1:
  - write the prompt to IOS_$STDOUT
  - loop
    - check for input with IOS_$GET with [IOS_$COND_OPT, IOS_$PREVIEW_OPT]
    - check for GPR event
    - wait a little while
    - repeat

  The behavior of this is almost right except that every time the IOS_$GET
  is executed, the transcript pad is repositioned to the bottom (as if
  something had been written).  IOS_$GET does the right thing, returning
  nothing read, but the transcript behavior is unacceptable.

Method 2:
  - write the prompt to IOS_$STDOUT
  - read the IOS EVENTCOUNT and add 1 to its value
  - read the GPR EVENTCOUNT and add 1 to its value
  - block using EC2_$WAIT

  The behavior of this is correct except that the prompt never appears in
  the shell input window.

Method 3:
  - write the prompt to IOS_$STDOUT
  - do an IOS_$GET with [IOS_$COND_OPT, IOS_$PREVIEW_OPT]
  - read the IOS EVENTCOUNT and add 1 to its value
  - read the GPR EVENTCOUNT and add 1 to its value
  - block using EC2_$WAIT

  The behavior of this is correct except now the prompt pops up in the
  transcript pad on a line of its own when the IOS_$GET is executed.

This just shouldn't be this hard.  My current feeling is that there is
a bug in IOS_$GET using [IOS_$COND_OPT].  It just shouldn't have any
effect on the input or transcript pads but it does.

Can anyone help me with this?

Thanks.

Jim

PS - I am using AEGIS 9.7 (the same problem occured with 9.6).

-------

mishkin@apollo.uucp (Nathaniel Mishkin) (02/24/88)

In article <8802220318.AA04482@ATHENA.CS.YALE.EDU> firby-james@YALE.ARPA (James Firby) writes:
>Okay, I give up.  I've been trying every way I can think of to do the
>following simple thing:  I want to print a prompt to an aegis shell
>standard output (ie. IOS_$STDOUT) so that it shows up in the shell input
>widnow and then WAIT until either a line is typed in, or a GPR event occurs.
>I can't find any way to do this right.

Prompt forcing.  What a mess.  I don't know if any variants of the
contortions you went to can be made to work, but simpler relief is at
hand though.  From "/sys/ins/pad.ins.pas":

    PROCEDURE pad_$force_prompt( 
        IN sid: stream_$id_t;
        OUT sts: status_$t 
        ); EXTERN;

This may have appeared only starting at sr9.7 (I'm not sure).  In any case,
what it does is force any current partial output line to be stuck into the
input window.

Enjoy.
-- 
                    -- Nat Mishkin
                       Apollo Computer Inc.
                       Chelmsford, MA
                       {decvax,mit-eddie,umix}!apollo!mishkin