Suppose we did something like:
- launch vim with
$ vim --clean - execute a shell command
:!echo "hello"
After step 1, if we exit Vim the terminal will contain:
$ vim --clean $ However after step 2, if we exit Vim the terminal will contain:
$ vim --clean hello Press ENTER or type command to continue $ The goal is to prevent any output staying in the terminal after exiting Vim. So after step 2 if we exit vim the terminal should only contain:
$ vim --clean $ I tried using :term ++curwin but I want a behaviour similar to running the command with :!cmd and I couldn't really come up with a solution with it (I could be missing something though). I want the whole screen to be used to run the command (not in a split for instance) and after the command execution is done I want to get prompted to press any key to continue. I thought about executing the command in a subshell or something but I am not really sure if that is achievable.
Note: The shell command could involve taking input from the user.