blob: d6846e6c941273d5f5af81db9fd0a67747bd6957 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "rc.h"
int
prompt(ushort *flag)
{
int fd, f = *flag;
if(f){
if(!readline(shell.prompt)){
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
runner->line++;
*flag = 0;
}
return 1;
}
|