无法为在 neovim 中运行的程序提供输入
Can't give input to programs ran in neovim
当我运行用C++或python编写的代码时,我无法为程序提供输入。 对于 C++
#include <stdio.h>
int main(){
int test;
scanf("%d", &test);
printf("%dn", test);
return 0;
}
输出
:!g++ -o run test.cpp && ./run 2>&1| tee /tmp/nvimPNNwAf/3
32767
(1 of 1): 32767
对于 python3
test = input()
输出
:!python3 test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
test = input()
EOFError: EOF when reading a line
shell returned 1
我知道我可以使用:term
它会修复它。但是我在:term
上遇到了问题.
当我输入时:
3
10 12 3 9
10 12 7 2
13 11 5 6
它应如下所示:
3
10 12 3 9
10 12 7 2
13 11 5 6
33
-1
83
但是,它输出:
3
10 12 3 9
10 13
2 7 2
13 11 5 6
1
1
如何解决此问题? (这在 Vim 中没有发生(
对于您问题的第一部分,这不是一个大功能,而是一个功能,因为在 neovim 中禁用了交互式 shell,您可以在此 GitHub 问题中看到 justimk 答案 https://github.com/neovim/neovim/issues/1496 解决方案是在 neovim 之外调用您的程序或使用插件来执行此操作。
相关文章:
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 无法在windows控制台中为C++程序提供必要的输入
- 更改.cpp程序的输入文件中数据的位置会意外更改输出
- 我试图制作一个程序,要求用户输入问题和答案,但程序循环不正确
- 我的程序没有从文件中读取并输入数据
- 3-3. 编写一个程序来计算每个不同单词在其输入中出现的次数
- LLVM | codegen 用于带有命令行选项的程序输入功能
- 程序输入名称和高度并显示它。我不知道如何显示列表中最高人的姓名和身高
- 程序输入密码并解锁窗口7,8,10
- 堆栈程序输入名称并重印在C 中
- C 程序输入超过某些输入行时行不通
- C++程序 - 输入文本流
- 当程序输入主要功能时,为什么要清除此std ::向量
- 在不模拟Ctrl+V的情况下将数据粘贴到任何应用程序输入字段中.Windows c++
- c++ 将函数输出重定向到编译的程序输入,反之亦然
- 程序输入只识别单词而不识别行
- 如何与Node.js进程中的C++程序输入流进行交互
- C++命令行实用程序输入文件的位置会更改行为
- 我的程序输入无法保存到文本文件中
- 提示用户为缩写程序输入字符串