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? – D. Ben Knoble Nov 16 '18 at 20:43C-lis redraw.C-lactually 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-lto 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
– Wumbo Nov 16 '18 at 23:15<C-\><C-n>and delete the text, because modifiable is off and cannot be turned on for a running process.:termand then press<C-l>in my spawned shell it clears the term screen – D. Ben Knoble Nov 16 '18 at 23:24C-cto end. Or just dosleep 10000and try toC-lbefore it is done. This is actually the case for a non-vim terminal as well. – Wumbo Nov 16 '18 at 23:27super-kon mac terminal would not. Just looking for the equivalent in vim term. – Wumbo Nov 16 '18 at 23:32set scbk=1to make it forget the old lines, thenset scbk=100000to get back to normal operation. It doesn't actually clear the window though. – Amadan Sep 18 '19 at 04:30'scrollback'). → https://vi.stackexchange.com/questions/21260/how-to-clear-neovim-terminal-buffer For vim it's 'termwinscroll' / 'twsl' but it doesn't quite work. (still leave a screenful of lines) Neither doestput reset,printf '\ec', (← by the way this makes the cursor blinks for some weird reason,printf '\e[2 q'to reset) – – user202729 Jan 25 '22 at 07:51