TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Tap curl in your editor before it gets to sh

60 点作者 awalGarg超过 8 年前

4 条评论

robryk超过 8 年前
Why do you create an env variable that contains the whole file in question when the editor returned success? Wouldn&#x27;t something like:<p><pre><code> cat &quot;$f&quot;; rm &quot;$f&quot; </code></pre> not involve loading the whole file in memory at once? Note that using this also makes sense with self-extracting archives&#x2F;shell scripts, because it lets you inspect the shell script at the beginning.
评论 #12944395 未加载
评论 #12944492 未加载
semi-extrinsic超过 8 年前
A much better feature is available in zsh, called safe-paste, that does this without the user having to insert &quot;tap&quot; or anything else manually. It relies on something called bracketed paste, where the terminal emulator sends special escape sequences to indicate the beginning and end of a paste. These are intercepted by the zsh plugin, which opens $EDITOR with the pasted content.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;robbyrussell&#x2F;oh-my-zsh&#x2F;blob&#x2F;master&#x2F;plugins&#x2F;safe-paste&#x2F;safe-paste.plugin.zsh" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;robbyrussell&#x2F;oh-my-zsh&#x2F;blob&#x2F;master&#x2F;plugin...</a>
评论 #12943882 未加载
评论 #12944019 未加载
sdx23超过 8 年前
I don&#x27;t really see, why I&#x27;d install something from some github repository if I can get it from a moreutils package that I like to have installed anyway.
评论 #12944320 未加载
评论 #12943886 未加载
tambourine_man超过 8 年前
Simple, but nice