有没有一种简单的方法可以将内容通过管道传输到编辑器原子?
例如:
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/