[bim] Add shell commands

This commit is contained in:
K. Lange 2018-08-16 12:16:07 +09:00
parent 9cf3fa4fe2
commit 991479501f
1 changed files with 13 additions and 0 deletions

View File

@ -920,6 +920,19 @@ void break_input(void) {
}
void process_command(char * cmd) {
/* special case ! */
if (*cmd == '!') {
printf("\033[0m\n\n");
set_buffered();
system(&cmd[1]);
printf("\n\nPress ENTER to continue.");
fflush(stdout);
set_unbuffered();
while (bim_getch() != ENTER_KEY);
redraw_all();
return;
}
char *p, *argv[512], *last;
int argc = 0;
for ((p = strtok_r(cmd, " ", &last)); p;