Skip to content

Comment on Run Last Shell Command by Hitting Enter a Few Times

Comments

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.