Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 11/03/84 (WLS Mods); site astrovax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!astrovax!wls From: wls@astrovax.UUCP (William L. Sebok) Newsgroups: net.unix-wizards Subject: Re: setting TERM - actually about terminal initialization Message-ID: <554@astrovax.UUCP> Date: Fri, 22-Feb-85 22:13:07 EST Article-I.D.: astrovax.554 Posted: Fri Feb 22 22:13:07 1985 Date-Received: Tue, 26-Feb-85 08:04:03 EST References: <1145@aecom.UUCP> <472@rlgvax.UUCP> Organization: Princeton Univ. Astrophysics Lines: 46 The fact that this subject has been brought up now gives me an excuse to get up upon the soap box. I am not happy with the way either BSD or USG Unix initializes the modes of terminals. I think that the present method of passing a magic cookie to getty by means of /etc/ttys or /etc/inittab is opaque and usually does not let one fully specify the initial modes of a terminal port. I further do not like the contortions one has to go through to initialize and retain the modes of terminal port without a getty, such as that of a line printer connected to a terminal port. I'd like to submit a counterproposal. These ideas are not original. 1) Define a tty ioctl that saves the current tty modes in an extra place in the kernel tty structure. Call these saved modes the "permanent tty modes". Make this ioctl executable by the superuser only. 2) Define a tty ioctl that resets the current tty modes by copying the permanent tty modes to the current tty modes. 3) Make /etc/rc set from a script permanent tty modes for all the terminal ports it knows about. 4) A tty would reset itself on close to the permanent tty modes. The most common getty mode could be one in which getty simply executes ioctl #2 to reset the tty modes from the permanent modes. This scheme would not help dialup or network lines (as much) but would greatly benefit the lines permanently attached to certain terminals. I believe that at most sites that this is the great majority of terminals. For instance, one would finally be able to consider fine tuning the various character delays to the terminal connected to that line. And, as previously mentioned, one can set a printer attached to a tty port to 1200 baud and have it stay that way with out having to do the horrible kluge of sleep 10000000 >/dev/ttyXX & to hold it open so that it doesn't reset its baud rate back to 300. I would also not mind seeing a TERM name stored in the terminal structure. I think that this makes more sense than storing it in the environment as a terminal type is logically more closely related to a tty port than it is to a process. A process could theoritically be controlling more than one terminal of different types. -- Bill Sebok Princeton University, Astrophysics {allegra,akgua,burl,cbosgd,decvax,ihnp4,noao,princeton,vax135}!astrovax!wls