#include "rc.h" /* static char promptbuf[7] = {'>', ' ', 0, ' ' , ' ', ' ', 0}; */ static char *base= "\x1b[1;31m" ">" "\x1b[0;0m" " ", *promptstr; void resetprompt(void) { promptstr = base; } int prompt(ushort *flag) { int f = *flag; if(f){ if(!readline(promptstr)){ runner->flag.eof = 1; return 0; } if(runner->cmd.io->e[-1] == '\n'){ runner->cmd.io->e[-1] = 0; addhistory(runner->cmd.io->b); runner->cmd.io->e[-1] = '\n'; } write(mapfd(0), "\n\r", 2); promptstr = " "; runner->line++; *flag = 0; } return 1; }