Ken Takata wrote:

> `: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.

The problem appears to be that t_te includes ESC [J, which clears the
screen.  When I remove the ":silent !ls" command is OK.

I wonder why it's in the default t_te entry.  Can we just remove it?

-- 
Bumper sticker: Honk if you love peace and quiet.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202002072203.017M3GLe008506%40masaka.moolenaar.net.

Raspunde prin e-mail lui