use bb_xbind/bb_xlisten
[oweals/busybox.git] / shell / msh.c
index e47af795ee3f498ed9f5f3e1bef8bdd1deb086d9..62e6b6e01e1640eac11df651d8ea4228c519c002 100644 (file)
@@ -27,6 +27,7 @@
  * Original copyright notice is retained at the end of this file.
  */
 
+#include "busybox.h"
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
@@ -46,7 +47,6 @@
 #include <sys/wait.h>
 
 #include "cmdedit.h"
-#include "busybox.h"
 
 
 /* Conditional use of "register" keyword */
@@ -93,6 +93,15 @@ int mshdbg_rc = 0;
 #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 @@ int msh_main(int argc, char **argv)
 #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");