diff --git a/src/kernel/apps/shell/args.c b/src/kernel/apps/shell/args.c index f670e6204f..31fc81181c 100644 --- a/src/kernel/apps/shell/args.c +++ b/src/kernel/apps/shell/args.c @@ -23,8 +23,10 @@ print_usage(bool error) fprintf((error ? stderr : stdout), kUsage); } -void init_arguments(int argc,char **argv){ +void +init_arguments(int argc,char **argv) +{ int cnt = 1; int shell_argc = 0; char name[255]; @@ -48,6 +50,10 @@ void init_arguments(int argc,char **argv){ gCommandToExecute = argv[cnt]; // ignore further args return; + case '-': + // ignore standard bash option + if (!strcmp(option, "--login")) + break; default: print_usage(true); exit(1); diff --git a/src/kernel/apps/shell/main.c b/src/kernel/apps/shell/main.c index c3871274f9..4ec0d1e5b8 100644 --- a/src/kernel/apps/shell/main.c +++ b/src/kernel/apps/shell/main.c @@ -19,6 +19,10 @@ #include "shell_history.h" +#define ECHO 0 + // echoes input when unequal 0 + + static int readline(char *buf, int len) { @@ -33,9 +37,11 @@ readline(char *buf, int len) // ESC -- used to display command history: // erase all characters on the current line, // then display the previously saved command +#if ECHO while (i--) { printf("\b"); } +#endif strcpy (buf, fetch_history_command()); i = printf("%s", buf); @@ -45,7 +51,9 @@ readline(char *buf, int len) // backspace: // erase the last character written if (i > 0) { +#if ECHO printf("\b"); +#endif --i; } break; @@ -53,12 +61,16 @@ readline(char *buf, int len) case '\n': buf[i] = 0; store_history_command(buf); +#if ECHO printf("\n"); +#endif return i; default: buf[i] = ch; +#if ECHO printf("%c", ch); +#endif i++; } }