0

Questions

  • How can I type something in there?
  • What even is the name of this thing?

Problem

If you type in for example

:!echo 'Hello World'

This kinda terminal thing pops up

I want to interact with it instead of it going away after the first key press. Example:

:!python3 -c 'input("Type a Number:")'

From the command above I get an Error.

I don't want to use the :terminal or any work arounds, I just want to know if this is possible^^


Thanks for your help :)

3
  • that's exactly the :terminal use case here Commented May 16, 2023 at 12:36
  • @ChristianBrabandt So it is not possible? Okay^^
    – Bog
    Commented May 16, 2023 at 13:42
  • I don't know if there are other ways to achieve this. I am merely telling you that you have found the :terminal use case here Commented May 16, 2023 at 15:08

1 Answer 1

2

There is a big difference between Vim and NeoVim when it comes to :!: the former runs the command in a shell-like environment, with stdin/stdout connected to the (p)TTY. The latter runs the subprocess in a "non-interactive" environment: essentially, no input is possible.

In both Vims you can use :terminal to have full interactivity; in NeoVim, this is the only builtin option.

Related: 1, 2.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.