pipe - 如何通过管道将输出传输到 Visual Studio Code 中?

标签 pipe stdin visual-studio-code

我想将命令的输出通过管道传输到 Visual Studio Code 中的新文本窗口中。

通常情况下,我会这样做:

echo foo | code

...但这似乎不起作用; Visual Studio Code 启动,但不显示输入。有没有办法在命令行上进行管道传输?

最佳答案

从版本 1.19.1 开始,您可以通过调用将输出传送到当前窗口:

<command> | code -
<小时/>

如果您使用的是 1.19 或更早版本,则不需要参数:

<command> | code

关于pipe - 如何通过管道将输出传输到 Visual Studio Code 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39418452/

相关文章:

使用输出重定向 (<) 管道进行 MySQL 转储导入的 Python Sh 库

plot - 如何从 stdin 读取数据到 gnuplot 并绘制相同的数据两次

python - 使用 sys.stdin 读取文本文件

bash - 如何将 stdin 从 shell 脚本重定向到 shell 脚本中的命令?

java - 在Vscode中如何跳转到错误行就像Intellij idea一样

visual-studio-code - 如何在 VS Code 中隐藏任意代码段?

bash - bash 进程替换和尾部的结果不正确?

python - 无法打开由 Python 中的线程创建的管道描述符

linux - 如何使用管道进行非阻塞 IPC(UART 仿真)

c# - 如何更改 C# 错误提示的语言?