wjc@ho5cad.att.com (William J Carpenter) (08/07/89)
[Environment: both sun3 and sun4, both sunOS 4.0.1 and 4.0.3] When I am running suntools on the console of a sun (where else?), there is some stty problem with canonical mode. Somehow, my stty changes for the special characters are being partially ignored. 1. $ stty intr ^C 2. $ sleep 10 3. (hit ^C, the sleep is interrupted, as expected) 4. $ stty intr ^X 5. $ sleep 10 6. (hit ^C, the sleep is interrupted, as expected) 7. $ stty werase ^_ 8. $ stty intr ^W 9. $ sleep 10 10. (hit ^W, the sleep is *not* interupted; hit ^C, also no effect) 11. $ stty -icanon 12. $ sleep 10 13. (hit ^W, the sleep is interupted, as expected) In steps 1-3, I use the BSD default interupt character ^C, and everything works as expected. In steps 4-6, I use ^X, which is not one of the pre-defined "special" characters for icanon. This also works. In steps 7-10, I use ^W. This is normally the BSD word-erase character, so I first clobber werase. This is the problem. Even though `stty -a` shows the settings one expects, the ^W won't work as an interrupt character. In steps 11-13, I just turn off icanon and things go back to normal. Of course, I can't operate in -icanon mode all the time. So, here is what I think is a summary of the problem: 1. When in suntools, some layer of this massive window conspiracy is noticing whether or not "icanon" is set. If so, it tries to do something with what it thinks are the special characters. 2. For example, if it sees ^W, it tries to do word erase, even though I have set stty so that ^W is interrupt. So, ^W doesn't work as interrupt. 3. When it sees ^C (the default interrupt), it passes it on down to our level. Since we have no special meaning for ^C (we overlaid it with ^W), that doesn't work as interrupt either. [Another possibility is that there is some hack in there so that "our level" doesn't interpret the icanon special characters, knowing that the mystery level already took care of it. Dunno.] 4. I have tried this with some of the other special characters (besides interrupt) with the same problem. It looks like some layer doesn't believe in changing them to whatever you want. 5. This is not a problem on the naked console or while rlogin'd. It only happens under suntools. (BTW, if you are under suntools and rlogin to someplace, even back to the same machine, rlogin uses -icanon, so the problem is hidden. A good way to fake yourself out, though.) I have no clue how to fix this. Got any ideas? This is quite annoying. -- Bill Carpenter att!ho5cad!wjc or attmail!bill