From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19029 invoked from network); 19 Mar 1997 18:31:35 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 19 Mar 1997 18:31:35 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA15519; Wed, 19 Mar 1997 12:58:52 -0500 (EST) Resent-Date: Wed, 19 Mar 1997 12:58:52 -0500 (EST) Date: Wed, 19 Mar 1997 18:01:21 GMT From: Zefram Message-Id: <22096.199703191801@stone.dcs.warwick.ac.uk> Subject: prompt emulation X-Patch: 208 Resent-Message-ID: <"uthj81.0.No3.Lb2Cp"@euclid> To: zsh-workers@math.gatech.edu Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3004 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- This patch changes the default prompt to "$ " or "# ", and the default secondary prompt to "> ", when emulating sh or ksh. (I also have plans for an emulation option to disable % prompt sequences.) -zefram *** Src/init.c 1997/03/17 00:38:09 1.40 --- Src/init.c 1997/03/19 00:16:13 *************** *** 446,457 **** #endif /* Set default prompts */ ! if (opts[INTERACTIVE]) { ! prompt = ztrdup("%m%# "); ! prompt2 = ztrdup("%_> "); ! } else { prompt = ztrdup(""); prompt2 = ztrdup(""); } prompt3 = ztrdup("?# "); prompt4 = ztrdup("+ "); --- 446,460 ---- #endif /* Set default prompts */ ! if(unset(INTERACTIVE)) { prompt = ztrdup(""); prompt2 = ztrdup(""); + } else if (emulation == EMULATE_KSH || emulation == EMULATE_SH) { + prompt = ztrdup(geteuid() ? "$ " : "# "); + prompt2 = ztrdup("> "); + } else { + prompt = ztrdup("%m%# "); + prompt2 = ztrdup("%_> "); } prompt3 = ztrdup("?# "); prompt4 = ztrdup("+ "); -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia Charset: ascii iQCVAwUBMy8zmXD/+HJTpU/hAQGxpAQAuqjnHVUSeUPzBFNnprM07GJZVAufFRh2 OyUmC4K6iuyM/mVqERTx4QdP0VVTKgOMonMN8VXiN8NhS9boPEqm4utbsH0odOn0 RHFMlS4GBXJSWqFuvL6b/OuuAjn6l8KtrxaUPUxqAxS47w/YFn+PzF6GzBuF4Cky 1jDsCHs2I9o= =OC7f -----END PGP SIGNATURE-----