0

Is it possible to open terminal window (:term) in vim in read-only mode?

I'd like to have this window interactive (for instance, to see compilation progress), but do not send keystrokes to it, so vim commands worked like in normal mode.

Now when I open terminal window with some command, then press ':', colon appears in terminal, while I'd like to switch to command mode.

5
  • Have you already read :h Terminal-Job and :h Terminal-Normal?
    – Matt
    Oct 29, 2020 at 11:11
  • <C-\><C-N> works, but terminal becomes non-interactive, it's not what is needed. But thank you anyway for info. Oct 29, 2020 at 11:34
  • It's hard to understand you. How do you think the terminal is supposed to know which "colon" should go to terminal process or should switch to the Vim's command-line? Naturally, some prefix (termwinkey defaults to <C-W>) is required.
    – Matt
    Oct 29, 2020 at 12:04
  • I do not want terminal to know which key should go to terminal process. I'd like not to send ANY key to terminal process at all. Oct 29, 2020 at 12:15
  • I’m not sure this is possible with the way this is currently implemented. Normal mode continues to buffer output, but does not update the window containing the buffer. A quick hack might be something like the commands maA<C-\><C-N>'a on a timer, to quickly “refresh” the actual window/buffer
    – D. Ben Knoble
    Oct 29, 2020 at 12:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.