add: get_line

This commit is contained in:
2024-10-09 22:10:22 +02:00
parent 50b1487708
commit fc8bc6a495
3 changed files with 11 additions and 4 deletions

View File

@ -77,10 +77,9 @@ void auto_complete(void)
void shell_init(void)
{
char *line;
kprintf(PROMPT);
while (1) {
if (line_status != NEWLINE)
continue;
while ((line = get_line())) {
bool invalid = true;
for (unsigned i = 0; i < NB_CMDS; i++) {
if (!strncmp(cmds[i].name, screen->line,
@ -97,7 +96,6 @@ void shell_init(void)
kprintf(KERN_WARNING "invalid command: %s\n",
screen->line);
memset(screen->line, '\0', sizeof(screen->line));
line_status = READING;
kprintf(PROMPT);
}
}