🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.misc
Article #250

MGR patch for SUN-OS 4.1

#250
From: Stephen A Uhler
Date: Mon, 30 Jul 1990 17:37
58 lines
2119 bytes
I finally found a Sun running OS 4.1, so here is the patch that lets MGR run.
It seems the semantics of the "read" system call was changed since 4.0.3
which causes the mouse to be a bit hesitant.

The only change is in src/set_mode.c

	*** NEW/set_mode.c
	--- OLD/set_mode.c
	***************
	*** 12,17 ****
	--- 12,18 ----
	  
	  /* muck with tty modes */
	  
	+ #include <fcntl.h>
	  #include <sgtty.h>
	  
	  /* set up tty input modes */
	***************
	*** 28,33 ****
	--- 29,35 ----
	  int file;				/* file descriptor */
	     {
	     set_mode(file,RAW,ECHO,B1200);
	+    fcntl(file,F_SETFL,fcntl(file,F_GETFL,0)|FNDELAY); /* for 4.1 */
	     return(ioctl(file,TIOCEXCL,0));
	     }
	  
In addition, it looks like /usr/ucb/vi uses terminfo instead of termcap,
so the set_termcap command isn't too useful.  The following shell script
will set the terminal size properly for terminfo:

	#!/bin/sh
	#       MGR set_terminfo for sun 4.1 (terminfo version of vi)  SAU 7/70
	
	ESC="^["  #   Fix to make the ^[ into the ESCAPE character
	stty -echo
	echo -n ${ESC}2I
	read rows cols xtra
	stty echo rows $rows cols $cols
	
In case you lost the terminfo entry supplied with MGR, this one should work ok:

	Px|mgr|SAU mgr teminal emulator,
		cols#80, lines#24,
		am, msgr,
		clear=^L, cr=^M, bel=^G,
		cub1=^H, cud1=\Ef, cuf1=\Er, cuu1=\Eu,
		ind=^J,
		cup=\E%p2%d;%p1%dM,
		csr=\E%p1%d;%p2%dt,
		wind=\E%p2%d;%p2%p4%+%d;%p1;%p1%p3%+%d;t,
		el=\Ec, ed=\EC,
		il1=\Ea, dl1=\Ed,
		il=\E%p1%da, dl=\E%p1%dd,
		smso=\Ei, rmso=\En,
		ht=^I,
		smcup=\E1664P, rmcup=\Et\Ep,
Technical Details
Message-ID: <25860@bellcore.bellcore.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!purdue!iuvax!rutgers!bellcore-2!bellcore!breeze!sau

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!purdue!iuvax!rutgers!bellcore-2!bellcore!breeze!sau
From: sau@breeze.bellcore.com (Stephen A Uhler)
Newsgroups: comp.windows.misc
Subject: MGR patch for SUN-OS 4.1
Keywords: MGR patch
Message-ID: <25860@bellcore.bellcore.com>
Date: 30 Jul 90 17:37:50 GMT
Sender: news@bellcore.bellcore.com
Reply-To: sau@bellcore.com (Stehpen A Uhler)
Followup-To: comp.windows.misc
Organization: Bell Communications Research, Morristown NJ
Lines: 58