diff --git a/src/ChangeLog b/src/ChangeLog index 6d6f383db..4c1da180f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2003-06-22 Pavel Roskin + * execute.c (do_execute): Make static. Print end of line after + "Press any key to continue" and user's keystroke, but before + restoring the panels. Eliminate last_paused variable. Don't + print fake prompt if there is no command. + * text.c: Eliminate. Move colors to color.c and clr_scr() to layout.c. * main.c (restore_console): Eliminate, use handle_console(). diff --git a/src/execute.c b/src/execute.c index f3799c0f5..8479e30a0 100644 --- a/src/execute.c +++ b/src/execute.c @@ -29,9 +29,6 @@ #include "execute.h" -/* to show nice prompts */ -static int last_paused = 0; - static void edition_post_exec (void) { @@ -88,7 +85,7 @@ pre_exec (void) } -void +static void do_execute (const char *shell, const char *command, int flags) { #ifdef HAVE_SUBSHELL_SUPPORT @@ -107,9 +104,8 @@ do_execute (const char *shell, const char *command, int flags) if (console_flag) handle_console (CONSOLE_RESTORE); - if (!use_subshell && !(flags & EXECUTE_INTERNAL && command)) { - printf ("%s%s%s\n", last_paused ? "\r\n" : "", prompt, command); - last_paused = 0; + if (!use_subshell && command && !(flags & EXECUTE_INTERNAL)) { + printf ("%s%s\n", prompt, command); } #ifdef HAVE_SUBSHELL_SUPPORT if (use_subshell && !(flags & EXECUTE_INTERNAL)) { @@ -133,11 +129,12 @@ do_execute (const char *shell, const char *command, int flags) && subshell_state != RUNNING_COMMAND #endif /* HAVE_SUBSHELL_SUPPORT */ ) { - printf ("%s\r\n", _("Press any key to continue...")); - last_paused = 1; + printf (_("Press any key to continue...")); fflush (stdout); mc_raw_mode (); getch (); + printf ("\r\n"); + fflush (stdout); } if (console_flag) { if (output_lines && keybar_visible) {