HCON SHARING TERMINAL WITH AN APPLICATION

ITEM: RTA000074659



My customer has an application that requires that HCON and                      
an application should share the same terminal. HCON is started                  
first and afterwards another application must gain control                      
of HCON's terminal, read and write data to the terminal and then                
relinquish control to HCON. Using SIGSTOP/SIGCONT on e789                       
works fine except for the fact that HCON loses the tab settings                 
of the mainframe screen. The customer has noticed that when he                  
uses the CTRL-C/CTRL-D sequence to start a shell, run an application            
and return to HCON this problem does not occur. The customer is                 
asking what could be done to prevent HCON from loading its tab setting          
in the mainframe screen.                                                        
                                                                                
ANSWER                                                                          
HCON is very fussy about the ioctl setting of the terminal. What I              
suggest is that you check the ioctl setting before the application is          
started and then again after it is completed. You could use 'stty -a' if        
you are at the command line, otherwise you will need to use the                 
ioctl subroutine. The only thing I can think of is that the application         
is changing the terminal settings ( is it a curses application ? ).             
I am not aware of other signals sent to HCON after a control-C but I            
suspect that HCON  saves the terminal setting when CONTROL-C is pressed         
and then restored after the shell exits. This would not happen when             
HCON received an external signal.                                               
I suggest you check the application first and if you are unable to change       
this then you may need to think about embedding the application in              
a program that saves the terminal settings, forks and execs the                 
application, and then before the parent exits resets the terminal               
settings.                                                                       
Here is a sample shell script that should do it.                                
                                                                               
#¢/bin/ksh                                                                      
TTY_SETTINGS=`stty -g < /dev/ttyX`  # where ttyX is the terminal                
application_name                                                                
stty $TTY_SETTINGS                                                              
                                                                                
S e a r c h - k e y w o r d s:                                                  
HCON AIX                                                                        
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000074659 ITEM: RTA000074659
Dated: 02/1995 Category: ITSAI6000GE
This HTML file was generated 99/06/24~12:43:27
Comments or suggestions? Contact us