From 29b56ef4e4113bcd091b19d6926f18814162ca53 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 26 Oct 2021 21:01:41 -0700 Subject: Feat(libunicode): Added an explicit unicode library Refactored code to pull out utf8 functions from base into a standalone library. Also left the required function inside arg.c so that code that calls ARG_BEGIN doesn't have to link to libunicode. --- sys/cmd/rc/prompt.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'sys/cmd/rc/prompt.c') 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; } -- cgit v1.2.1