🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #73376

RFC - gstty

#73376
From: Andrew Vanderstock
Date: Wed, 02 Oct 1991 09:10
147 lines
5602 bytes
I am one of the people working on gstty, the GNU stty replacement for 
(guess what?) stty.

Here is a proto-manual that I have written, and I am asking for comments,
critisisms, and new features that I might have missed...

--Begin Inclusion

I think there should be three parts of stty :
	o pretty  - a curses based terminal setter
	o gstty   - the actual program (reformed and much better command set)
	o xpretty - a x-based front end to gstty similar in style to pretty, but
		    with x-widgets to select various settings for example.

	I would like to write stty which should be called gstty for sake of
logical naming (ie gcc, gawk, etc...). It would have logical features that
simplify the current (horrid) interface to such an extent that the old
features would quickly die out, although we have to provide compatibility
with them for quite some time.

I propose the following command set :

(set tabstop=8 if you are using vi ...)

gstty -set [variable[=value[,value]]|all|everything|help|?]
      -mode [[-]mode|help|?]
      -enable [[-]signal|help|?]
      -term [terminal|help|?]
      -map [key[=binding[,binding]]|help|?|all|everything|default]
      -sane
      -reset
      -interactive
      -help [command|variable]
      -?

And have a global /usr/local/etc/sttyrc or similar file which can provide
aliases like :

alias disable 'enable -$*'		# saves code! :-)
alias isig 'set sig=on'			# emulate the old command set! 
alias default ... 			# and so on and on...

The idea being that if the user uses the old command set, they can, and
saves stty from being a HUGE application, but this incurs a penalty for
the using old command set as the old set and any aliases are only read
in after stty has failed in its command parsing.

Commands (In order of appearance...)

1. Set

	The command 'set' is used to set all sorts of variables and
	settings so that it reduces huge numbers of commands down to a
	smaller, more manageable number. This makes stty faster and
	smaller... 

1.1 Set Variables

speed		{ 75, 300, ..., 38400 } 	sets the speed of the
						terminal

size		x,y				sets the size of the
						screen
lines, rows					ditto, but only one value
cols, columns					ditto,  "   "    "    "
parity		even|odd|off			sets parity
charactersize	5|6|7|8				sets character size
hangup		on|off|true|false		sets hangup action
stop		7|8				sets stop bits
receiver	on|off|true|false		sets receiver
local		on|off|true|false		sets local (loop) mode
xon		on|off|true|false		allows xon/xoff flow
						control
delay		val,[val...]			sets delay values
break		break, SIGINT,			sets what break does.

1.2 Mode settings

raw		Enter raw mode
cooked		Enter cooked mode 
cbreak		Enter cbreak mode
xon		Enable xon/xoff flow control
xany		Enable any key (including ^Q) to restart flow
maxbel		bell sounded on buffer full, but no flush
exten		Allow extended character set.
sane		enter sane mode (very pessimistic about what terminals
		about)
dec		set terminal up for dec family... 
normal		set stty to default values
default		ditto

1.3 Enable

break		Enable break action, action defined by set break variable
hangup		Enable hangup action

1.4 Term

	I have about 200+ terminal definitions in my account, I didn't
write most of them, but I can get permission to use the definitions so we
can easily use stty to do the job of term... But by changing the defs a
little we can add all the correct settings for stty. This could take a
while as most of the terminals mentioned are very old...

you type

gstty -term vt100

and stty is correctly setup for a vt100 as default ready for sh, etc to
take over.

1.5 Map

	I am going to use the standard key binding names from curses (see
curses(3x) for more info, near the back...) to specify the action taken by
the key so you can bind more than just the carriage return action... But
for starters, the standard CR CRNL bindings will be enough. I will add
actions as time goes on...

	So about 20 odd old commands are replaced in one hit, and this
makes stty faster and smaller as well.

1.6 Sane/Reset

	These reduce typing for quick recovery after a crashed (insane)
terminal. Very equivalent to gstty -mode sane. The idea being that many old
scripts are compatible, and gstty remains fast.

1.7 Interactive

	Loads up pretty (or xpretty if term is set to xterm) and allows the
user with no or little familiarity with gstty or stty to set modes quickly
and get correct terminal definitions. The pretty program should reset the 
mode of the terminal + changes when it leaves... So that a calling program
like nn or elm doesn't get upset about being in cbreak mode or similar.

1.8 Help (or your adviser)

	Help is available on all commands and there is a help mode which
basically is a clever interactive manual page... Similar to emacs'
help mode (^H-key). 

This post will form the first basis of the manual to gstty.

Andrew Vanderstock
s902255@sunrise.bf.rmit.oz.au
--End Inclusion.
Technical Details
Message-ID: <1991Oct2.091000.9204@minyos.xx.rmit.oz.au>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!munnari.oz.au!bruce!goanna!minyos.xx.rmit.oz.au!s902255

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,63a7ce5359d7b466,start
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1991-10-02 16:34:00 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!munnari.oz.au!bruce!goanna!minyos.xx.rmit.oz.au!s902255
From: s902255@minyos.xx.rmit.oz.au (Andrew Vanderstock)
Newsgroups: gnu.misc.discuss
Subject: RFC - gstty
Message-ID: <1991Oct2.091000.9204@minyos.xx.rmit.oz.au>
Date: 2 Oct 91 09:10:00 GMT
Organization: RMIT Computer Centre, Melbourne Australia.
Lines: 147