TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why does the `reset` command include a delay? (2017)

81 pointsby eklitzkeabout 1 year ago

5 comments

dataflowabout 1 year ago
I love the "It's harmless with a terminal emulator". I (obviously) get what they're saying, but you'd think making millions of people waste 3 seconds of their lives every time would be considered at least a modicum of harm.
评论 #39638572 未加载
评论 #39640573 未加载
fuzztesterabout 1 year ago
Back in the day, when the screen&#x2F;terminal was borked, due to <i>cat</i>ting a binary or other reasons, we used to do;<p><pre><code> stty sane Ctrl-J </code></pre> or other variants. It mostly worked. Last resort was to switch the terminal off and on, and&#x2F;or to kill the login shell from another terminal, IIRC.<p>See: man stty
评论 #39639281 未加载
DeathArrowabout 1 year ago
&gt;Real (hardware) terminals need that.<p>I wonder who uses real terminals and for what.
评论 #39638878 未加载
评论 #39638426 未加载
评论 #39640433 未加载
评论 #39653963 未加载
评论 #39638523 未加载
评论 #39639181 未加载
aumerleabout 1 year ago
To workaround it add the following to your shell&#x27;s rc file:<p>function reset { printf &#x27;\e]\e\\\ec&#x27; }<p>Uses the VT100 RIS escape code to ask the terminal to reset itself. But first it send an empty OSC escape to reset the terminals VT parser back to normal mode, so that the RIS escape code is parsed correctly. No need to depend on any external utilities like tput or the reset binary. This should work with any halfway decent terminal emulator.
charcircuitabout 1 year ago
&gt;and since there&#x27;s no conventional way to tell the difference (and too hard to determine if some escape sequence might do a hardware-reset), reset assumes your terminal is real.<p>The TERM environmental variable can be used
评论 #39638492 未加载