aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/prompt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/rc/prompt.c')
-rw-r--r--sys/cmd/rc/prompt.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/cmd/rc/prompt.c b/sys/cmd/rc/prompt.c
index d6846e6..6a32d59 100644
--- a/sys/cmd/rc/prompt.c
+++ b/sys/cmd/rc/prompt.c
@@ -1,21 +1,30 @@
#include "rc.h"
+static char promptbuf[7] = {'>', ' ', 0, ' ' , ' ', ' ', 0};
+
+void
+resetprompt(void)
+{
+ promptbuf[2] = 0;
+}
int
prompt(ushort *flag)
{
- int fd, f = *flag;
+ int f = *flag;
+
if(f){
- if(!readline(shell.prompt)){
+ if(!readline(promptbuf)){
runner->flag.eof = 1;
return 0;
}
- fd = mapfd(0);
- write(fd, "\n\r", 2);
- shell.prompt = "> "; // NOTE: can't use tab here: we have a hacky prompt length computation
+ write(mapfd(0), "\n\r", 2);
+
+ promptbuf[2] = ' ';
runner->line++;
*flag = 0;
}
+
return 1;
}