* prompt emulation
@ 1997-03-19 18:01 Zefram
0 siblings, 0 replies; only message in thread
From: Zefram @ 1997-03-19 18:01 UTC (permalink / raw)
To: zsh-workers
-----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-----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-03-19 18:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-19 18:01 prompt emulation Zefram
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).