Hi,
`:help :!` says:
Vim redraws the screen after the command is finished,
because it may have printed any text. This requires a
hit-enter prompt, so that you can read any messages.
To avoid this use: >
:silent !{cmd}
< The screen is not redrawn then, thus you have to use
CTRL-L or ":redraw!" if the command did display
something.
However, I think this is not accurate.
If 't_ti' and 't_te' are set to empty, then `:silent !{cmd}` keeps showing the
output of the command. User needs to use CTRL-L to show the Vim screen again.
(This behavior matches the help.)
On the other hand, if 't_ti' and 't_te' are set to default, Vim uses alternate
screen, then `:silent !{cmd}` shows a blank screen after the execution of the
command (even the command didn't display anything). User still needs to use
CTRL-L to show the Vim screen again.
This behavior differs from the help, and I don't think it is useful at all.
How about restoring the Vim screen automatically when alternate screen is
enabled? E.g.:
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1469,6 +1469,8 @@ do_shell(
wait_return(term_console ? -1 : msg_silent == 0); // see below
# else
wait_return(msg_silent == 0);
+ if (swapping_screen() && msg_silent > 0)
+ redraw_later_clear();
# endif
no_wait_return = save_nwr;
}
The help should be also updated.
Regards,
Ken Takata