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.

Run Last Shell Command by Hitting Enter a Few Times

1 pointsby bebrws9 months ago

1 comment

bebrws9 months ago
After running a command in the terminal, I often find myself needing to run the same command again, without wanting or being able to easily re-type the command or use the arrow keys (think mobile). This post contains ZSH scripting that keeps track of the last non-empty ZSH command prompt/buffer and runs it whenever I send a few empty lines by pressing the enter key 2 times in a row.