[comp.unix.ultrix] Patch to xterm to work around csh bug...

mellon@nigiri.pa.dec.com (Ted Lemon) (05/29/91)

I've received several requests for the patch to xterm to work around
the problem with 8-bit backspaces in the DEC-supplied C Shell.   I'm
therefore posting the patch.   Please beware that DEC in no way
warrants that this patch will work at all, nor that the software that
you produce with it will not erase all your disks and paint pictures
of Alfred E. Neuman on all of your CRTs.

I'd also like to point out that the current release of Ultrix (Ultrix
4.2) comes with a different set of MIT clients than you're used to -
it comes with the X11R4 clients.   The clients that we ship are linked
with the standard MIT libraries, not the DEC libraries, and are up to
PatchLevel 18 with a few bug fixes that were needed to support Ultrix
4.0 and higher.

If you don't like building X11 every time you get a new version of
Ultrix, go ahead and use these bits - unless you have your own local
hacks, they should be the same as the bits you'd produce by doing a
build yourself.  Naturally, I am making no warrantees about the
fitness of those bits for your use or their Alfred E. Neuman painting
habits...

			       _MelloN_

Here's the patch:

mit/clients/xterm/main.c differs:
*** base-pool/mit/clients/xterm/main.c	Wed Nov 14 10:52:44 1990
--- local-pool/mit/clients/xterm/main.c	Sun Dec 16 12:13:45 1990
***************
*** 318,323 ****
--- 318,324 ----
      Boolean utmpInhibit;
      Boolean sunFunctionKeys;	/* %%% should be widget resource? */
      Boolean wait_for_map;
+     Boolean deccshfix;
  } resource;
  
  /* used by VT (charproc.c) */
***************
*** 343,348 ****
--- 344,351 ----
  	offset(sunFunctionKeys), XtRString, "false"},
      {"waitForMap", "WaitForMap", XtRBoolean, sizeof (Boolean),
          offset(wait_for_map), XtRString, "false"},
+     {"decCShellFix", "DecCShellFix", XtRBoolean, sizeof (Boolean),
+ 	offset (deccshfix), XtRString, "false"},
  };
  #undef offset
  
***************
*** 424,429 ****
--- 427,434 ----
  {"-rv",		"*reverseVideo",XrmoptionNoArg,		(caddr_t) "on"},
  {"+rv",		"*reverseVideo",XrmoptionNoArg,		(caddr_t) "off"},
  {"-w",		".borderWidth", XrmoptionSepArg,	(caddr_t) NULL},
+ /* Fix for problem with DEC C Shell... */
+ {"-deccshfix",	".decCShellFix", XrmoptionNoArg,	(caddr_t) "on"},
  };
  
  static struct _options {
***************
*** 479,484 ****
--- 484,490 ----
  { "-n string",             "icon name for window" },
  { "-C",                    "intercept console messages, if supported" },
  { "-Sxxd",                 "slave mode on \"ttyxx\", file descriptor \"d\"" },
+ { "-deccshfix",		   "Modify BS+parity handling to fix problem with DEC csh" },
  { NULL, NULL }};
  
  static char *message[] = {
***************
*** 667,672 ****
--- 673,683 ----
  	XtGetApplicationResources( toplevel, &resource, application_resources,
  				   XtNumber(application_resources), NULL, 0 );
  
+ 	/* Handle -deccshfix flag: */
+ 	if (resource.deccshfix) {
+ 	    extern int groundtable [];
+ 	    groundtable [0x88] = groundtable [0x8];
+ 	}
  	waiting_for_initial_map = resource.wait_for_map;
  
  	/*