[comp.soft-sys.andrew] typescript on hp300_ux70 problem

ajp+@ANDREW.CMU.EDU (Andrew Palay) (12/21/90)

Excerpts from internet.info-andrew: 13-Dec-90 typescript on hp300_ux70
pr.. Kris Olander@lombard.dar (507)

> Keywords: tty, job control

> Typescript is giving me the following warning when it starts up.
> -------------
> Warning: no access to tty; thus no job control in this shell...
> --------------

> Also, I'm getting command echos every time I type a command.
> 'echo' isn't set in my shell.  As a matter of fact, when I type 'set echo',
> I get two echos.  I've seen this in the past, the only difference seems to
> be that now, I see the command as I'm typing it in, and also after hitting
> carriage return.

> -Kris Olander



This is a poblem with HP's csh and typescript.  We haven't been figured
out how to get it to work properly and are open to suggestions. I
believe typescript works properly with ksh on the HP machine.

Andy

tinglett+@rchland.ibm.com (Todd Inglett) (12/21/90)

Excerpts from ext.cmu.info-andrew: 20-Dec-90 Re: typescripton
hp300_ux7.. Andrew Palay@RCHGATE.rch (823+0)

> Excerpts from internet.info-andrew: 13-Dec-90typescript on hp300_ux70
> pr.. Kris Olander@lombard.dar (507)

>> Keywords: tty, job control

>> Typescript is giving me the following warning when itstarts up.
>> -------------
>> Warning: no access to tty; thus no job control in thisshell...
>> --------------

>> Also, I'm getting command echos every time I type acommand.
>> 'echo' isn't set in my shell.  As a matter of fact,when I type 'set echo',
>> I get two echos.  I've seen this in the past, the onlydifference seems to
>> be that now, I see the command as I'm typing it in,and also after hitting
>> carriage return.

>> -Kris Olander



> This is a poblem with HP's csh and typescript.  We haven't beenfigured
> out how to get it to work properly and are open to suggestions. Ibelieve
> typescript works properly with ksh on the HP machine.

> Andy


There are 2 problems here.  First, csh does not have a
controllingterminal.  That is why it prints the Warning:... message.  It
needs acontrolling terminal to do job control.  Second, the pty is not
in REMOTEmode.  That is why everything is getting echoed.

Try changing the code in tscript.c,typescript__InitializeObject to call
GetPtyandName (see the #iffor SY_AIX221) and have it close(ptyChannel)
before the fork.  Then, inthe child do a ptyChannel = open(ptyname, 2) 
(again, see the #if forSY_AIX221).  This second open must be done after
a setpgrp().  Do aps and see which processes have controlling terminals.
 It is ok fortypescript to be missing a terminal, but the csh must
haveone.  Also, you should be able to echo foobar > /dev/tty in
thetypescript.  I am assuming here that HP/UX has System V type rules
forinheriting a controlling terminal.

To solve the REMOTE problem, check your manuals for the TIOCREMOTE mode
underthe pty man page.  There is a hack in typescript__InitializeObject
to set thismode.  Perhaps HP has changed the encoding of ioctls.  Try
coding the ioctlwithout a hack like that (i.e. using TIOCREMOTE).  If
you cannot get this towork, I can send you code that allows the pty to
stay in normal mode.

-todd inglett