From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14549 invoked from network); 8 Jan 1997 10:10:14 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 8 Jan 1997 10:10:14 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id FAA19225; Wed, 8 Jan 1997 05:08:33 -0500 (EST) Resent-Date: Wed, 8 Jan 1997 05:08:33 -0500 (EST) From: Zefram Message-Id: <28439.199701081009@stone.dcs.warwick.ac.uk> Subject: shout vs. stderr To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Wed, 8 Jan 1997 10:09:44 +0000 (GMT) X-Patch: 187 X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]8697.11 X-US-Congress: Moronic fuckers Content-Type: text Resent-Message-ID: <"fpP9t3.0.Ki4.W8tqo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2743 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- This patch changes some uses of stderr to shout. There are several other uses of stderr, but I'm not sure that any of them should be using the terminal directly. -zefram *** Src/hist.c 1996/12/24 06:12:14 1.18 --- Src/hist.c 1997/01/07 21:19:04 *************** *** 684,692 **** ptr = ztrdup(chline); if ((flag & (HISTFLAG_DONE | HISTFLAG_RECALL)) == HISTFLAG_DONE) { ! zputs(ptr, stderr); ! fputc('\n', stderr); ! fflush(stderr); } if (flag & HISTFLAG_RECALL) { PERMALLOC { --- 684,692 ---- ptr = ztrdup(chline); if ((flag & (HISTFLAG_DONE | HISTFLAG_RECALL)) == HISTFLAG_DONE) { ! zputs(ptr, shout); ! fputc('\n', shout); ! fflush(shout); } if (flag & HISTFLAG_RECALL) { PERMALLOC { *** Src/main.c 1996/12/31 17:08:45 1.5 --- Src/main.c 1997/01/07 21:26:11 *************** *** 80,86 **** if (!(isset(IGNOREEOF) && interact)) { #if 0 if (interact) ! fputs(islogin ? "logout\n" : "exit\n", stderr); #endif zexit(lastval, 0); continue; --- 80,86 ---- if (!(isset(IGNOREEOF) && interact)) { #if 0 if (interact) ! fputs(islogin ? "logout\n" : "exit\n", shout); #endif zexit(lastval, 0); continue; *** Src/utils.c 1997/01/07 21:16:09 1.54 --- Src/utils.c 1997/01/07 21:16:39 *************** *** 690,697 **** if (st.st_size && st.st_atime <= st.st_mtime && st.st_mtime > lastmailcheck) if (!u) { ! fprintf(stderr, "You have new mail.\n"); ! fflush(stderr); } else { char *usav = underscore; --- 690,697 ---- if (st.st_size && st.st_atime <= st.st_mtime && st.st_mtime > lastmailcheck) if (!u) { ! fprintf(shout, "You have new mail.\n"); ! fflush(shout); } else { char *usav = underscore; *************** *** 700,716 **** u = dupstring(u); if (! parsestr(u)) { singsub(&u); ! zputs(u, stderr); ! fputc('\n', stderr); ! fflush(stderr); } underscore = usav; } LASTALLOC; } if (isset(MAILWARNING) && st.st_atime > st.st_mtime && st.st_atime > lastmailcheck && st.st_size) { ! fprintf(stderr, "The mail in %s has been read.\n", unmeta(*s)); ! fflush(stderr); } } *v = c; --- 700,716 ---- u = dupstring(u); if (! parsestr(u)) { singsub(&u); ! zputs(u, shout); ! fputc('\n', shout); ! fflush(shout); } underscore = usav; } LASTALLOC; } if (isset(MAILWARNING) && st.st_atime > st.st_mtime && st.st_atime > lastmailcheck && st.st_size) { ! fprintf(shout, "The mail in %s has been read.\n", unmeta(*s)); ! fflush(shout); } } *v = c; *************** *** 1128,1140 **** break; } if (strchr(valid_chars, c)) { ! write(2, "\n", 1); break; } feep(); if (icntrl(c)) ! write(2, "\b \b", 3); ! write(2, "\b \b", 3); } if (isem) { if (c != '\n') --- 1128,1140 ---- break; } if (strchr(valid_chars, c)) { ! write(SHTTY, "\n", 1); break; } feep(); if (icntrl(c)) ! write(SHTTY, "\b \b", 3); ! write(SHTTY, "\b \b", 3); } if (isem) { if (c != '\n') *************** *** 1142,1148 **** } else { settyinfo(&shttyinfo); if (c != '\n' && !valid_chars) ! write(2, "\n", 1); } return (int)c; } --- 1142,1148 ---- } else { settyinfo(&shttyinfo); if (c != '\n' && !valid_chars) ! write(SHTTY, "\n", 1); } return (int)c; } *************** *** 1277,1285 **** rstring = best; Rstring = guess; pptbuf = putprompt(sprompt, &pptlen, NULL, 1); ! fwrite(pptbuf, pptlen, 1, stderr); free(pptbuf); ! fflush(stderr); feep(); x = getquery("nyae "); } else --- 1277,1285 ---- rstring = best; Rstring = guess; pptbuf = putprompt(sprompt, &pptlen, NULL, 1); ! fwrite(pptbuf, pptlen, 1, shout); free(pptbuf); ! fflush(shout); feep(); x = getquery("nyae "); } else *************** *** 2222,2228 **** feep(void) { if (isset(BEEP)) ! write(2, "\07", 1); } /**/ --- 2222,2228 ---- feep(void) { if (isset(BEEP)) ! write(SHTTY, "\07", 1); } /**/ -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMtLAuHD/+HJTpU/hAQFm4QP/aBxnC9cJfhMVT/DQNDpHi8NcLV9Iw7wC jRXrQiFUVJHY19twob4v5d0dVwVJcL7IDRTxMauyuiNQXp86QaAV6M6sZXxw/rvF KlVtzAbo1jcr7W0IDaBEfXlSMUtDK4g0hNBwbDShLUmyhqA59d67FTOCFI+tT9Ch V/OAu093iS4= =fY8P -----END PGP SIGNATURE-----