microvty: re-display prompt on empty command

This commit is contained in:
Harald Welte 2021-03-28 16:46:15 +02:00
parent f962556911
commit 1cc7bad32e
1 changed files with 4 additions and 1 deletions

View File

@ -100,8 +100,11 @@ void microvty_try_recv(void)
return;
if (c == '\r' || c == '\n' || g_cmds.buf_idx >= sizeof(g_cmds.buf)-1) {
/* skip empty commands */
if (g_cmds.buf_idx == 0)
if (g_cmds.buf_idx == 0) {
printf("\r\n");
microvty_print_prompt();
return;
}
cmd_execute();
cmd_buf_reset();
printf(g_cmds.prompt);