118 Terminal Insanity Alan Bawden has this to say about the situation: Date: Wed, 13 Nov 91 14:47:50 EST From: Alan Bawden Alan@lcs.mit.edu To: UNIX-HATERS Subject: Don’t tell me about curses What this is saying is so brain damaged it brings tears to my eyes. On the one hand, Unix requires every program to manually generate the escape sequences necessary to drive the user’s terminal, and then on the other hand Unix makes it hard to send them. It’s like going to a restaurant without a liquor license where you have to bring your own beer, and then the restaurant gives you a dribble-glass to drink it from. Customizing your terminal settings Try to make sense of this, and you’ll soon find your .cshrc and .login files accumulating crufty snippets of kludgy workarounds, each one designed to handle a different terminal or type of network connection. The problem is that without a single coherent model of terminals, the different programs that do different tasks must all be told different vital statistics. telnet and rlogin track one set of customizations, tset another set, and stty yet a third. These subsystems act as though they each belong to different labor unions. To compound the problem, especially in the case of stty, the subsystems take different commands and options depending on the local chapter they belong to, that is, which Unix they operate on. (The notion of a transparent networked environment in Unix is an oxymoron.) Our following correspon- dent got hit with shrapnel from all these programs: Date: Thu, 31 Jan 1991 11:06-0500 From: “John R. Dunning” jrd@stony-brook.scrc.symbolics.com To: UNIX-HATERS Subject: Unix vs terminal settings So the other day I tried to telnet into a local Sun box to do something or other, but when I brought up emacs, it displayed a little itty-bitty window at the top of my virtual terminal screen. I got out of it and verified that my TERM and TERMCAP environment variables were set right, and tried again, but nope, it was convinced my terminal was only a few lines high. I thrashed around for a while, to no avail, then finally gave up in disgust, sent mail off to the local Unix wizard (who shall remain nameless, though I think he's on this list) asked how the
The Magic of Curses 119 bleep Unix decides the size of my terminal and what should I do about it, and used Zmacs, like I should have done in the first place. The wizard answered my mail with a marginally cryptic “Unix defaults, probably. Did you check the stty rows & columns settings?” I should have known better, but I never do, so I went to ask him what that really meant. We logged into the offending Sun, and sure enough, typing “stty all” revealed that Unix thought the terminal was 10 lines high. So I say, “Why is it not sufficient to set my env vars?” “Because the information’s stored in different places. You have to run tset.” “But I do, in my login file.” “Hmmm, so you do. tset with no args. I wonder what that does?” “Beats me, I just copied this file from other old Unices that I had accounts on. Perhaps if I feel ambitious I should look up the docu- mentation on tset? Or would that confuse me further?” “No, don't do that, it’s useless.” “Well, what should I do here? What do you do in your init file?” He prints out his init file. “Oh, I just have this magic set of cryptic shell code here. I don't know how it works, I’ve just been carrying it around for years…” Grrr. At this point I decided it was futile to try to understand any of this (if even the local wizard doesn't understand it, mere mortals should probably not even try) and went back to my office to fix my init file to brute-force the settings I wanted. I log in, and say “stty all,” and lo! It now thinks my terminal is 48 lines high! But wait a second, that’s the value we typed in just a few minutes ago. Smelling something rotten in the state of the software, I tried a few experiments. Turns out a bunch of your terminal settings get set in some low-level terminal-port object or someplace, and nobody bothers to initialize them when you log in. You can easily get somebody else’s leftover stuff from their last session. And, since information about terminal characteristics is strewn all over the place, rather than being kept in some central place, there are all kinds
Previous Page Next Page