Is it legal to do
:r!vi in vi?
A friend asked me to try it and it jammed my terminal. What exactly causes this? Is there anyway to recover the terminal without closing it and opening a new one?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
If you're looking for why it jams your terminal it's because
:r! reads a command from your terminal and inserts it into the buffer. Since it's trying to insert the output of the
vi command, it's waiting for
vi to finish. But all it does is open another instance of vi, which never returns.
Is it legal?
:r! takes a valid shell command and
vi is a valid shell command. It's just not advised because of the aforementioned behavior.
:help :r! for more info.