Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site uwmacc.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!uwvax!uwmacc!myers From: myers@uwmacc.UUCP (Latitudinarian Lobster) Newsgroups: net.sources.bugs Subject: Bug in wm under csh... Message-ID: <1423@uwmacc.UUCP> Date: Sun, 25-Aug-85 18:46:27 EDT Article-I.D.: uwmacc.1423 Posted: Sun Aug 25 18:46:27 1985 Date-Received: Tue, 27-Aug-85 01:46:26 EDT Distribution: net Organization: Ken Kopp's Fresh Seafood Tank Lines: 96 When there's a ! in your terminal's termcap entry, and you do an ESCt while in wm under the csh, the ! is not properly escaped, and the setenv command fails. Here's a diff -- *** misc.c.orig Sun Aug 25 17:12:49 1985 --- misc.c Sun Aug 25 17:21:45 1985 *************** *** 256,262 /* * Send a setenv command for wmvirt terminal to shell in window w. ! * Note: this is a sad kludge. If fails if 'vi' or anything * other than the wm-activated shell is active in the window. * It is rumored that 4.3 BSD supports an ioctl to change * the window size (and corresponding signals that are understood --- 256,262 ----- /* * Send a setenv command for wmvirt terminal to shell in window w. ! * Note: this is a sad kludge. It fails if 'vi' or anything * other than the wm-activated shell is active in the window. * It is rumored that 4.3 BSD supports an ioctl to change * the window size (and corresponding signals that are understood *************** *** 277,282 { register int i, fd; register char *s, *lasts; #ifdef SNEAKYTERMCAP if (mode < 3) { --- 277,283 ----- { register int i, fd; register char *s, *lasts; + int iscsh; #ifdef SNEAKYTERMCAP if (mode < 3) { *************** *** 322,329 * shellnames *ending* with csh as a clue that a csh is runnning. * (This check is also made by the SUSPEND command.) */ ! if ((i = strlen(shellname)) >= 3 ! && strcmp(shellname+i-3,"csh") == 0) s = "\nsetenv TERM wmvirt; setenv TERMCAP '"; else s = "\nexport TERM TERMCAP; TERM=wmvirt; TERMCAP='"; --- 323,330 ----- * shellnames *ending* with csh as a clue that a csh is runnning. * (This check is also made by the SUSPEND command.) */ ! if ((i = strlen(shellname)) >= 3 && strcmp(shellname+i-3,"csh") == 0) { ! iscsh = 1; s = "\nsetenv TERM wmvirt; setenv TERMCAP '"; } else *************** *** 325,330 if ((i = strlen(shellname)) >= 3 && strcmp(shellname+i-3,"csh") == 0) s = "\nsetenv TERM wmvirt; setenv TERMCAP '"; else s = "\nexport TERM TERMCAP; TERM=wmvirt; TERMCAP='"; --- 326,332 ----- if ((i = strlen(shellname)) >= 3 && strcmp(shellname+i-3,"csh") == 0) { iscsh = 1; s = "\nsetenv TERM wmvirt; setenv TERMCAP '"; + } else s = "\nexport TERM TERMCAP; TERM=wmvirt; TERMCAP='"; *************** *** 338,344 * A TTYHOG of 255 is much too small, but lots of systems have that. */ lasts = s; for (i = 0; s[i]; i++) { ! if (s[i] == killchar() || s[i] == erasechar()) { if (i) (void) write(fd, s, i); (void) write(fd, "\\", 1); --- 340,346 ----- * A TTYHOG of 255 is much too small, but lots of systems have that. */ lasts = s; for (i = 0; s[i]; i++) { ! if ((iscsh && s[i]=='!') || s[i]==killchar() || s[i]==erasechar()) { if (i) (void) write(fd, s, i); (void) write(fd, "\\", 1);