#define BB_FEATURE_SORT_REVERSE
//
// Enable command line editing in the shell.
-// Only relevant if BB_SH is enabled.
+// Only relevant if BB_SH is enabled. On by default.
#define BB_FEATURE_COMMAND_EDITING
//
// Enable tab completion in the shell. This is now working quite nicely.
//
//Allow the shell to invoke all the compiled in BusyBox applets as if they
//were shell builtins. Nice for staticly linking an emergency rescue shell,
-//among other things.
+//among other things. Off by default.
// Only relevant if BB_SH is enabled.
-#define BB_FEATURE_SH_STANDALONE_SHELL
+//#define BB_FEATURE_SH_STANDALONE_SHELL
//
//When this is enabled, busybox shell applets can be called using full path
//names. This causes applets (i.e., most busybox commands) to override
//will use BusyBox cat even if /bin/cat exists on the filesystem and is _not_
//busybox. Some systems want this, others do not. Choose wisely. :-) This
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
-// Only relevant if BB_SH is enabled.
-#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
+// Only relevant if BB_SH is enabled. Off by default.
+//#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
//
// Some deeply embedded systems don't have usernames or even hostnames,
// and the default prompt can look rather hideous on them. Uncomment
// this option for a simpler, path-only prompt (which was the default until
-// around BusyBox-0.48):
-#define BB_FEATURE_SIMPLE_PROMPT
+// around BusyBox-0.48). On by default.
+// Only relevant if BB_SH is enabled.
+#define BB_FEATURE_SH_SIMPLE_PROMPT
//
//Turn on extra fbset options
//#define BB_FEATURE_FBSET_FANCY
// mere mortals so leave this stuff alone.
//
#if defined BB_MOUNT || defined BB_UMOUNT || defined BB_DF
-#ifdef BB_FEATURE_MOUNT_MTAB_SUPPORT
-#define BB_MTAB
-#endif
+ #ifdef BB_FEATURE_MOUNT_MTAB_SUPPORT
+ #define BB_MTAB
+ #endif
#else
-#undef BB_MTAB
+ #undef BB_MTAB
#endif
//
-#if defined BB_FEATURE_COMMAND_EDITING && defined BB_SH
-#define BB_CMDEDIT
+#if defined BB_SH
+ #if defined BB_FEATURE_COMMAND_EDITING
+ #define BB_CMDEDIT
+ #ifndef BB_FEATURE_USE_TERMIOS
+ #define BB_FEATURE_USE_TERMIOS
+ #endif
+ #else
+ #undef BB_FEATURE_COMMAND_EDITING
+ #undef BB_FEATURE_COMMAND_TAB_COMPLETION
+ #undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
+ #define BB_FEATURE_SH_SIMPLE_PROMPT
+ #endif
+#else
+ #undef BB_FEATURE_COMMAND_EDITING
+ #undef BB_FEATURE_SH_APPLETS_ALWAYS_WIN
+ #undef BB_FEATURE_SH_STANDALONE_SHELL
+ #undef BB_FEATURE_SH_SIMPLE_PROMPT
#endif
//
#ifdef BB_KILLALL
-#ifndef BB_KILL
-#define BB_KILL
-#endif
+ #ifndef BB_KILL
+ #define BB_KILL
+ #endif
#endif
//
#ifndef BB_INIT
-#undef BB_LINUXRC
-#undef BB_FEATURE_LINUXRC
+ #undef BB_LINUXRC
+ #undef BB_FEATURE_LINUXRC
#endif
//
#ifdef BB_GZIP
-#ifndef BB_GUNZIP
-#define BB_GUNZIP
-#endif
+ #ifndef BB_GUNZIP
+ #define BB_GUNZIP
+ #endif
#endif
//
#ifdef BB_DPKG
-#ifndef BB_DPKG_DEB
-#define BB_DPKG_DEB
-#endif
+ #ifndef BB_DPKG_DEB
+ #define BB_DPKG_DEB
+ #endif
#endif
//
#ifdef BB_DPKG_DEB
-#ifndef BB_AR
-#define BB_AR
-#endif
-#ifndef BB_TAR
-#define BB_TAR
-#endif
-#ifndef BB_FEATURE_TAR_GZIP
-#define BB_FEATURE_TAR_GZIP
-#endif
+ #ifndef BB_AR
+ #define BB_AR
+ #endif
+ #ifndef BB_TAR
+ #define BB_TAR
+ #endif
+ #ifndef BB_FEATURE_TAR_GZIP
+ #define BB_FEATURE_TAR_GZIP
+ #endif
#endif
//
#ifdef BB_TAR
-#ifdef BB_FEATURE_TAR_GZIP
-#ifndef BB_GUNZIP
-#define BB_GUNZIP
-#endif
-#endif
+ #ifdef BB_FEATURE_TAR_GZIP
+ #ifndef BB_GUNZIP
+ #define BB_GUNZIP
+ #endif
+ #endif
#endif
//
#if defined BB_MOUNT && defined BB_FEATURE_NFSMOUNT
-#define BB_NFSMOUNT
-#endif
-//
-#if defined BB_FEATURE_COMMAND_EDITING
-#ifndef BB_FEATURE_USE_TERMIOS
-#define BB_FEATURE_USE_TERMIOS
-#endif
+ #define BB_NFSMOUNT
#endif
//
#if defined BB_IFCONFIG
-#ifdef BB_FEATURE_IFCONFIG_STATUS
-#define BB_INTERFACE
-#endif
+ #ifdef BB_FEATURE_IFCONFIG_STATUS
+ #define BB_INTERFACE
+ #endif
#else
-#undef BB_INTERFACE
+ #undef BB_INTERFACE
#endif
//
#if defined BB_FEATURE_AUTOWIDTH
-#ifndef BB_FEATURE_USE_TERMIOS
-#define BB_FEATURE_USE_TERMIOS
-#endif
+ #ifndef BB_FEATURE_USE_TERMIOS
+ #define BB_FEATURE_USE_TERMIOS
+ #endif
#endif
//
#if defined BB_INSMOD || defined BB_LSMOD
-#if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
-#define BB_FEATURE_NEW_MODULE_INTERFACE
-#endif
+ #if ! defined BB_FEATURE_NEW_MODULE_INTERFACE && ! defined BB_FEATURE_OLD_MODULE_INTERFACE
+ #define BB_FEATURE_NEW_MODULE_INTERFACE
+ #endif
#endif
//
#ifdef BB_SYSLOGD
-#if defined BB_FEATURE_IPC_SYSLOG
-#define BB_LOGREAD
-#endif
+ #if defined BB_FEATURE_IPC_SYSLOG
+ #define BB_LOGREAD
+ #endif
#endif
//
#if defined BB_DOS2UNIX
-#define BB_UNIX2DOS
+ #define BB_UNIX2DOS
#endif
#define BB_FEATURE_COMMAND_TAB_COMPLETION
#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
-#undef BB_FEATURE_SIMPLE_PROMPT
+#undef BB_FEATURE_SH_SIMPLE_PROMPT
#define BB_FEATURE_CLEAN_UP
#define D(x) x
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
#endif
-#if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
#endif
static int len; /* --- "" - - "" - -"- --""-- --""--- */
static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */
static
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
const
#endif
char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */
static int my_euid;
#endif
-#ifndef BB_FEATURE_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
static char *hostname_buf = "";
static int num_ok_lines = 1;
#endif
cursor = 0;
}
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
static void parse_prompt(const char *prmt_ptr)
{
cmdedit_prompt = prmt_ptr;
history_counter++;
}
}
-#if !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
num_ok_lines++;
#endif
}
#if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION)
input_tab(0); /* strong free */
#endif
-#if !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
free(cmdedit_prompt);
#endif
return;
{
char buff[BUFSIZ];
char *prompt =
-#if !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
"\\[\\033[32;1m\\]\\u@\\[\\x1b[33;1m\\]\\h:\
\\[\\033[34;1m\\]\\w\\[\\033[35;1m\\] \
\\!\\[\\e[36;1m\\]\\$ \\[\\E[0m\\]";
res = putenv(v);
if (res)
fprintf(stderr, "export: %m\n");
-#ifndef BB_FEATURE_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
if (strncmp(v, "PS1=", 4)==0)
PS1 = getenv("PS1");
else if (strncmp(v, "PS2=", 4)==0)
static inline void cmdedit_set_initial_prompt(void)
{
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
PS1 = NULL;
PS2 = "> ";
#else
static inline void setup_prompt_string(char **prompt_str)
{
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
/* Set up the prompt */
if (shell_context == 0) {
if (PS1)
res = putenv(v);
if (res)
fprintf(stderr, "export: %m\n");
-#ifndef BB_FEATURE_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
if (strncmp(v, "PS1=", 4)==0)
PS1 = getenv("PS1");
else if (strncmp(v, "PS2=", 4)==0)
static inline void cmdedit_set_initial_prompt(void)
{
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
PS1 = NULL;
PS2 = "> ";
#else
static inline void setup_prompt_string(char **prompt_str)
{
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
/* Set up the prompt */
if (shell_context == 0) {
if (PS1)
#define BB_FEATURE_COMMAND_TAB_COMPLETION
#define BB_FEATURE_COMMAND_USERNAME_COMPLETION
#define BB_FEATURE_NONPRINTABLE_INVERSE_PUT
-#undef BB_FEATURE_SIMPLE_PROMPT
+#undef BB_FEATURE_SH_SIMPLE_PROMPT
#define BB_FEATURE_CLEAN_UP
#define D(x) x
#undef BB_FEATURE_COMMAND_USERNAME_COMPLETION
#endif
-#if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if defined(BB_FEATURE_COMMAND_USERNAME_COMPLETION) || !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
#define BB_FEATURE_GETUSERNAME_AND_HOMEDIR
#endif
static int len; /* --- "" - - "" - -"- --""-- --""--- */
static char *command_ps; /* --- "" - - "" - -"- --""-- --""--- */
static
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
const
#endif
char *cmdedit_prompt; /* --- "" - - "" - -"- --""-- --""--- */
static int my_euid;
#endif
-#ifndef BB_FEATURE_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
static char *hostname_buf = "";
static int num_ok_lines = 1;
#endif
cursor = 0;
}
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
static void parse_prompt(const char *prmt_ptr)
{
cmdedit_prompt = prmt_ptr;
history_counter++;
}
}
-#if !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
num_ok_lines++;
#endif
}
#if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION)
input_tab(0); /* strong free */
#endif
-#if !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
free(cmdedit_prompt);
#endif
return;
{
char buff[BUFSIZ];
char *prompt =
-#if !defined(BB_FEATURE_SIMPLE_PROMPT)
+#if !defined(BB_FEATURE_SH_SIMPLE_PROMPT)
"\\[\\033[32;1m\\]\\u@\\[\\x1b[33;1m\\]\\h:\
\\[\\033[34;1m\\]\\w\\[\\033[35;1m\\] \
\\!\\[\\e[36;1m\\]\\$ \\[\\E[0m\\]";
res = putenv(v);
if (res)
fprintf(stderr, "export: %m\n");
-#ifndef BB_FEATURE_SIMPLE_PROMPT
+#ifndef BB_FEATURE_SH_SIMPLE_PROMPT
if (strncmp(v, "PS1=", 4)==0)
PS1 = getenv("PS1");
else if (strncmp(v, "PS2=", 4)==0)
static inline void cmdedit_set_initial_prompt(void)
{
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
PS1 = NULL;
PS2 = "> ";
#else
static inline void setup_prompt_string(char **prompt_str)
{
-#ifdef BB_FEATURE_SIMPLE_PROMPT
+#ifdef BB_FEATURE_SH_SIMPLE_PROMPT
/* Set up the prompt */
if (shell_context == 0) {
if (PS1)