stdin - 如何使 atom.io 读取 STDIN?

标签 stdin atom-editor

有没有一种简单的方法可以将内容通过管道传输到编辑器原子?

例如:

echo "Content." | atom

不幸的是atom没有获取到内容。当前版本的 gedit 具有参数 - 以启用读取 STDIN:

echo "Content." | gedit -

我在 atom-help (atom -h) 中找不到类似的选项

最佳答案

感谢您提出这个问题!我刚刚遇到了同样的问题。

Is there an easy way to pipe content to the editor atom?

当前的 atom 命令行界面 (CLI) 不会打开通过管道传输到其标准输入 (stdin) 的内容。

有一个 Pull Request打开以添加此功能。提议的解决方案将 stdin 中的内容写入 /tmp 中的文件,然后在 Atom 中打开该文件。

现在,如果您愿意破解 atom CLI,您可以手动应用 the changes proposed there .

关于stdin - 如何使 atom.io 读取 STDIN?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33237732/

相关文章:

来自管道的 Bash 输入

c - 两个进程读取相同的标准输入

java - 标准输入/输出流

encoding - 如何 “save with encoding”

css - ATOM - CSSLINT 忽略 ids

editor - Atom 不会搜索 (ctrl-p) 文件,这些文件不在当前 git 存储库(灰色文件夹)中

python - 为什么 Python 在打印回溯时从当前目录读取?

c - 通过 fread 从 stdin 读取 unsigned int

atom-editor - 原子: how to diff two files using split-diff

javascript - 根据eslint配置保存时在atom编辑器中美化js代码