Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stty command causes script to exit

Status
Not open for further replies.

motoslide

MIS
Oct 30, 2002
764
US
We have an application which doesn't play well if the stty values for ROWS or COLUMNS are set. This is easy to resolve by clearing those stty flags before launching the application. However, I've got one Client system where a change to those values causes the script to exit.
We are running SCO OpenServer 5.0.X and /bin/sh.

Simply put:
cd /app_dir
stty rows 0 columns 0
exec ./startmyapp

If the rows and columns are already clear, the application runs fine. If they are currently set to some values, the stty takes affect, but the script bails back to the shell.
I've tried moving the "stty" command to the $HOME/.profile, but that also causes the user to drop to a UNIX ($) prompt instead of completing the .profile commands.

Is there some kind of trap value I'm missing here?

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
If they are currently set to some values
Where are those values coming from ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Some of the Terminal Emulation packages we use pass those through (the mechanism of how that actually happens in unknown to me). In Putty, for instance, I can set my ROWS and COLUMNS to be 17 and 65 (respectively), then when I connect, those become the corresponding stty values for my session.
Another common way that this propogates across multiple servers is that your stty settings follow you. If I log onto UNIX serverA with bad stty values, then telnet to UNIX serverB, I've just polluted the stty settings for that pseudo terminal as well.
This is a little annoyance I've lived with for years, but I've never encountered the symptom above where changing the stty values causes the process to abort (no error).

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
And are the LINES and COLUMNS environment variables set properly when the application doesn't play well ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I don't have to unset or change those to make the application happy. They DO appear to inherit the values passed by the Terminal Emulation program. I'm not sure if the environment variables follow the stty values or vice-versa, but changing COLUMNS and LINES alone does not resolve the screen problem within the application.

Thanks for the idea, though. I hadn't thought to play with those.

"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top