From: shag@glia.biostr.washington.edu (Shag {Official Random})
Subject: Shag's Stupid GeoComm Tricks
Summary: GeoComm VT100 Termcap Hack Zap Fry Sizzle Ka-BOOM.
Keywords: This might get a little technical, hope John reads it!
Organization: University of Washington
Date: Fri, 18 Dec 1992 05:02:38 GMT


I was one of the first people to report the bugs in GeoComm's vt100 emulation
to this group, and as I use it heavily, I've accumulated an awful lot of info
regarding it.  Tonight, I decided to solve my problems, and instead ended up
with GEOS rebooting every time I tried to use GeoComm, for about 15 minutes.
Feh.

GeoComm uses (for some reason) the semicolon as a comment delimiter.  This is
all good and well, except that the vt-100s and all their descendents use it in
some control codes which are, in certain situations, difficult to avoid.  When
GeoComm receives one of these codes, it goes on a GeoKillingSpree, and 9 times
of ten, a system reboot is necessary.

When this first surfaced, a message was posted explaining GEOS termcaps.

-----
;$Id: vt100.tc,v 1.4 90/09/07 23:50:43 brianc Exp $
;bell
^G		0
;left
^H		1
;tab
^I		2
;down
^J		3
;return
^M		4
;scroll down
;\EM		5
;up arrow
^Z		6
;down arrow
^J		7
;right arrow
;\EOC		8
;left arrow
^U		9
;F1
;\EOP		10
;F2
;\EOQ		11
;F3
;\EOR		12
;F4
;\EOS		13
;clear&home
^L		14
;num lock on
^O\E0P		15
;num lock off
^O\E0`		16
;cursor up
^Z		17
;cursor right
\E[C		18
;cursor home
;		19
;clear 2 end o screen
\Ek		20
;clear 2 end o line
\EK		21
;normal mode (no inverse)
^O		22
;save cursor
;\E7		23
;restore cursor
;\E8		24
;change scroll reg
;\E[%i%d;%i%dr	25
;gotoxy
\EY%+ %c%+ %c	26
;bold on	27
;underscore on	28
;blink on	29
;reverse on
^N		30
;insert line
;\E[L		31
;back tab	32
;delete line
;\E[M		33
;delete char
;\E[P		34
;insert char	35
;go status	36
;insert mode
;\E[4h		37
;leave insert mode
;\E[4l		38
;scroll up
;\ED		39
;term init	40
;sane reset	41
;graphics on
;\E[%dm		42
;set row
;\E[%i%dH	43
;set column
;\E[;%i%dH	44
;underscore off 45
;reverse off	46
^O
;set tab	47
;clear tab	48
;visible bell
;\Evb		49
;cursor down many
;\E[%dB		50
;cursor left many
;\E[%dD		51
;cursor right many
;\E[%dC		52
;cursor up many
;\E[%dA		53
-----

I kept a copy of the file, and after studying the termcap files on my host at
some length, and talking to the resident telecom gurus at more length, decided
that simply redefining those codes - on _both_ ends of the connection - would
solve matters.  The gurus concurred.  This was a Good Thing.

I cooked up a modified version of the file above, including the information
from the above post, and information about the 'termcap' terminal capability
database, ('man 5 termcap' shows the manual page on my host, your mileage may
vary.)

-----
;$Id: vt100.tc,v 1.4 90/09/07 23:50:43 brianc Exp $
;string		geos #	termcap	function
^G		0	;bl	bell
^H		1	;le	left
^I		2	;ta	tab
^J		3	;do	down
^M		4	;cr	return
\EM		5	;sf	scroll text up
\EOA		6	;ku	up arrow
\EOB		7	;kd	down arrow
\EOC		8	;kr	right arrow
\EOD		9	;kl	left arrow
\EOP		10	;k0	F1
\EOQ		11	;k1	F2
\EOR		12	;k2	F3
\EOS		13	;k3	F4
\E[;H\E[2J	14	;cl	Clear
\E[?1h\E=	15	;ks	Num on
\E[?1l\E>	16	;ke	Num off
\E[A		17	;up	cursor up
\E[C		18	;nd	cursor right
\E[H		19	;ho	cursor home
\E[J		20	;cd	clear 2 end o screen
\E[K		21	;ce	clear 2 end o line
\E[m		22	;me	normal mode (no inverse)
\E7		23	;sc	save cursor
\E8		24	;rc	restore cursor
\E[%i%d;%i%dr	25	;cs	change scroll region
\E[%i%d;%i%dH	26	;cm	goto xy
;		27	;md	bold on
;		28	;us	underscore on
;		29	;mb	blink on
\E[1;7m		30	;mr	reverse on
\E[L		31	;al	insert line
;		32	;bt	back tab
\E[M		33	;dl	delete line
\E[P		34	;dc	delete char
;		35	;ic	insert char
;		36	;ts	go status
\E[4h		37	;im	insert mode
\E[4l		38	;ei	leave insert mode
\ED		39	;sr	scroll text down
;		40	;is	term init
;		41	;rs	sane reset
\E[%dm		42	;ac	graphics on
\E[%i%dH	43	;cv	set row
\E[;%i%dH	44	;ch	set column
;		45	;ue	underscore off
;		46	;se	reverse off
;		47	;st	set tab
;		48	;ct	clear tab
\Evb		49	;vb	visible bell
\E[%dB		50	;DO	cursor down many
\E[%dD		51	;LE	cursor left many
\E[%dC		52	;RI	cursor right many
\E[%dA		53	;UP	cursor up many
-----

Fellow telecom hackers might find this file somewhat interesting, particularly
those who deal with Unix.  Anyway, I then took the standard VT-100 termcap
entry on my host...

-----
d0|vt100|DEC VT100:\
	:ae=^O:as=^N:bl=^G:cd=\E[J:ce=\E[K:cm=\E[%i%d,%dH:co#80:cr=^M:\
	:cs=\E[%i%d,%dr:ct=\E[3g:DO=\E[%dB:do=^J:ho=\E[H:is=\E<\E)0:it#8:\
	:k0=\EOP:k1=\EOQ:k2=\EOR:k3=\EOS:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:\
	:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:l0=PF1:l1=PF2:l2=PF3:l3=PF4:LE=\E[%dD:\
	:le=^H:li#24:ll=\E[24H:mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:ms:nd=\E[C:\
	:nw=\EE:rc=\E8:RI=\E[%dC:\
	:rs=^X\E<\E2\E[?9h^]\E^L^X\E[20l\E[?3;9;6l\E[r\E[m\E[q\E(B^O\E)0\E>:\
	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:ue=\E[m:UP=\E[%dA:\
	:up=\EM:us=\E[4m:vt#3:xo:\
	:cl=\E[H\E[J:\
	:bs:kn#4:pt:
-----

And combined the two, replacing any semicolons with commas, so that GeoComm
would not misinterpret command strings as comments.  I wound up with two 
files - a termcap entry of my very own... 

-----
gc|GEOS|GeoComm-vt100:\
	:co#80:li#24:vt#3:bl=^G:le=^H:ta=^I:do=^J:cr=^M:sf=\EM:\
	:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:k0=\EOP:k1=\EOQ:k2=\EOR:\
	:k3=\EOS:cl=\E[,H\E[2J:ks=\E[?1h\E=:ke=\E[?1l\E>:\
	:up=\E[A:nd=\E[C:ho=\E[H:cd=\E[J:ce=\E[K:me=\E[m:\
	:sc=\E7:rc=\E8:cs=\E[%1%d,%i%dr:cm=\E[%i%d,%i%dH:\
	:md=\E[1m:us=\E[4m:mb=\E[5m:mr=\E[7m:\
	:al=\E[L:dl=\E[M:dc=\E[P:im=\E[4h:ei=\E[4l:sr=\ED:\
	:is=\E[1,24r\E[24,1H\E[?7h\E[?4l:\
	:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
	:ac=\E[%dm:cv=\E[%i%dH:ch=\E[,%i%dH:ue=\E[m:re=\E[m:\
	:st=\EH:ct=\E[3g:vb=\Evb:\
	:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:\
-----

... and a GEOS termcap file with more functions defined than you could shake
a pointy stick at.

-----
;$Id: vt100.tc,v 1.4.8sh 92/12/17 22:50:43 shag Exp $
:xn
^G			0
^H			1
^I			2
^J			3
^M			4
\EM			5
\EOA			6
\EOB			7
\EOC			8
\EOD			9
\EOP			10
\EOQ			11
\EOR			12
\EOS			13
\E[,H\E[2J		14
\E[?1h\E=		15
\E[?1l\E>		16
\E[A			17
\E[C			18
\E[H			19
\E[J			20
\E[K			21
\E[m			22
\E7			23
\E8			24
\E[%i%d,%i%dr		25
\E[%i%d,%i%dH		26
\E[1m			27
\E[4m			28
\E[5m			29
\E[7m			30
\E[L			31
\E[M			33
\E[P			34
\E[4h			37
\E[4l			38
\ED			39
\E[1,24r\E[24,1H\E[?7h\E[?4l	40
\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h	41
\E[%dm			42
\E[%i%dH		43
\E[,%i%dH		44
\E[m			45
\E[m			46
\EH			47
\E[3g			48
\Evb			49
\E[%dB			50
\E[%dD			51
\E[%dC			52
\E[%dA			53
-----

I saved this file in TVI950.TC (since I don't use that terminal type), so as
to still have a normal vt100 available.  I then modified my dialup script to
use the TVI950 file, and modified my .login to default to terminal type GEOS,
as defined in my termcap entry.

It went boom.  The cursor hopped down to the right lower corner of the window
and the system locked.  After about 15 minutes of repeated reboots and 
resetting the professional workspace, I renamed TVI950.TC so that it couldn't
find it, and it went back to being a normal vt100.

I'm relatively certain I hacked this in a logical manner, making both ends
match, et cetera.  The fact that I can't even select the emulation (let alone
make a call) without GEOS locking up indicates that GEOS itself is having a
problem with the .TC file as it now exists.

I know that my hacked .TC file has a _very_ high percentage of the available
functions defined, easily more than the stock VT100 or ANSI entries.  I also 
know that the version of VT100.TC I was working from was v1.4, and the
current shipping version is at _least_ v1.4.8.  Lastly, I know that GeoWorks
has no plans (according to this newsgroup) to add features to or remove bugs
from GeoComm for version 2.0 of the operating system (beyond any that would
be inherently added by the OS's inherent increase in features), and so, if
something's gonna get done, it's gonna get done by users. :)

Therefore, questions:

1) Are there some functions that I just plain should NOT define?
	(in layman's terms, bugs!)

2) Has the list of available functions to define changed since 1990 in such a
	way that defining functions according to the old list would crash
	GEOS?

3) If so, can someone (John?) please post a current list of functions?
	(this is where the "open systems" bit comes in ;)

Any suggestions or ideas anyone has on this are more than welcome, as I really
want to get this working, and logically it _should_ be entirely feasible.  I'm
sorry this was so long, but I wanted to include all the pertinent files.  I'm
also sorry if this went over a lot of heads, but, well, anyone whose head it
went over probably didn't read this far. ;)

And yes, if I get this working, I _will_ post the solution to the net. :)

Happy Holiday Hacking,

	-Shag

-- 
+----------------------------------------------------------------------+
| Dan "Shag" Birchall, Official Random, Jeff's Machine.		       +-+
| The University of Washington is not responsible for me.  Lucky them. | |
+-+--------------------------------------------------------------------+ |
Newsgroups: comp.os.msdos.pcgeos