diff --git a/subsys/shell/shell.c b/subsys/shell/shell.c index a331464ba09..9596ae1b2ff 100644 --- a/subsys/shell/shell.c +++ b/subsys/shell/shell.c @@ -1449,12 +1449,6 @@ int shell_start(const struct shell *sh) z_shell_vt100_color_set(sh, SHELL_NORMAL); } - /* print new line before printing the prompt to clear the line - * vt100 are not used here for compatibility reasons - */ - z_cursor_next_line_move(sh); - state_set(sh, SHELL_STATE_ACTIVE); - /* * If the shell is stopped with the shell_stop function, its backend remains active * and continues to buffer incoming data. As a result, when the shell is resumed, @@ -1463,6 +1457,12 @@ int shell_start(const struct shell *sh) */ z_shell_backend_rx_buffer_flush(sh); + /* print new line before printing the prompt to clear the line + * vt100 are not used here for compatibility reasons + */ + z_cursor_next_line_move(sh); + state_set(sh, SHELL_STATE_ACTIVE); + z_shell_unlock(sh); return 0;