svn commit: trunk/busybox/shell

vapier at busybox.net vapier at busybox.net
Tue Jun 6 06:26:13 UTC 2006


Author: vapier
Date: 2006-06-05 23:26:12 -0700 (Mon, 05 Jun 2006)
New Revision: 15296

Log:
make the default prompt suck less when using fancy prompts

Modified:
   trunk/busybox/shell/msh.c


Changeset:
Modified: trunk/busybox/shell/msh.c
===================================================================
--- trunk/busybox/shell/msh.c	2006-06-06 06:19:19 UTC (rev 15295)
+++ trunk/busybox/shell/msh.c	2006-06-06 06:26:12 UTC (rev 15296)
@@ -93,6 +93,15 @@
 #endif							/* MSHDEBUG */
 
 
+#ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
+# define DEFAULT_ROOT_PROMPT "\\u:\\w> "
+# define DEFAULT_USER_PROMPT "\\u:\\w$ "
+#else
+# define DEFAULT_ROOT_PROMPT "# "
+# define DEFAULT_USER_PROMPT "$ "
+#endif
+
+
 /* -------- sh.h -------- */
 /*
  * shell
@@ -877,9 +886,9 @@
 #ifdef CONFIG_FEATURE_SH_FANCY_PROMPT
 	if (prompt->value == null)
 #endif
-		setval(prompt, "$ ");
+		setval(prompt, DEFAULT_USER_PROMPT);
 	if (geteuid() == 0) {
-		setval(prompt, "# ");
+		setval(prompt, DEFAULT_ROOT_PROMPT);
 		prompt->status &= ~EXPORT;
 	}
 	cprompt = lookup("PS2");




More information about the busybox-cvs mailing list