Vim's new :terminal
feature is pretty neat, but when I run something like a rails server, I want to be able to clear logging output every now and then.
The usual methods in a non-vim term window don't seem to work, like <D-k>
(Cmd-k clears scrollback in Terminal.app on macOS), etc.
I've tried <C-w>:Clear<CR>
, but it seems to be for something different as well.
If I weren't running a rails server, I could just type clear
in the terminal.
I glanced through :help :term
, and I'm not seeing what I want jump out at me.
<C-l>
the standard clear key?C-l
is redraw.C-l
actually does look like it clears the term window in Vim, but inconveniently it does not work when you have a process like rails server running. It has to be implemented by vim itself, because obviously if I use the terminal's actual clear key, it will wipe the whole screen including vim (which of course comes back if I hitC-l
to redraw). Perhaps this is just an edge case the new feature just hasn't addressed yet. Because it should be simple. You also can't<C-\><C-n>
and delete the text, because modifiable is off and cannot be turned on for a running process.:term
and then press<C-l>
in my spawned shell it clears the term screenC-c
to end. Or just dosleep 10000
and try toC-l
before it is done. This is actually the case for a non-vim terminal as well.