From dfeae746617c883d921cc8900c1b1d162983bcfb Mon Sep 17 00:00:00 2001
From: Ludwig Ortmann <ludwig.ortmann@fu-berlin.de>
Date: Mon, 18 Mar 2013 15:37:32 +0100
Subject: [PATCH] lose > before output, prompt when ready for input

---
 sys/shell/shell.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/shell/shell.c b/sys/shell/shell.c
index 3762bc820d..c17908a8c0 100644
--- a/sys/shell/shell.c
+++ b/sys/shell/shell.c
@@ -144,17 +144,25 @@ static int readline(shell_t *shell, char* buf, size_t size) {
     return 1;
 }
 
+static inline void print_prompt(shell_t *shell)
+{
+    shell->put_char('>');
+    shell->put_char(' ');
+    return;
+}
+
 void shell_run(shell_t *shell) {
     char line_buf[255];
 
+    print_prompt(shell);
     while(1) {
         int res = readline(shell, line_buf, sizeof(line_buf));
-        shell->put_char('>');
         if (! res ) {
             char* line_copy = strdup(line_buf);
             handle_input_line(shell, line_copy);
             free(line_copy);
         }
+        print_prompt(shell);
     }
 }
 
-- 
GitLab