Pause and wait until ENTER is pressed in a beautiful screen before executing the command.
When you have a bit complex terminal development workflow possibly with tmux (and maybe tmuxp), sometime you need to let a script automatically create specific panes for different uses. A personal usecase for me was to have 3 tmux tabs to connect to development, staging, and production environments. But I didn't want to be always connected to these environments. What I wanted was a way to keep the command pre filled in the tab so I can execute it whenever I need to.
Now, there are multiple ways to do that.
- Just keep the command typed and not executed in the terminal. You can do this easily in tmuxp. But usually you want to re-run these kind of commands which is difficult when you have to go through the command history.
- Run a command like
read -p "Press enter to continue" && <you command>. But it looks so ugly (read on) - Or you could use
delayed😎
Say you want to run the command echo "Hello, World!"; sleep 10s when you press enter on the terminal.
Then just run delayed 'echo "Hello, World!"; sleep 10s' which will show a beautiful responsive banner until you press ENTER to continue or 'q' to abort.
When you press ENTER, the script you defined will be executed as expected
Not only that, once the script is executed, it will automatically go back to the banner, allowing you to re-run the same command.
Aaand... if the command failed, the banner will also show the return value of the last run.
Currenty this project does not have a release cycle. To install, clone the repo and follow the steps.
- Make sure you have
golangin your system
go version
- Build and install
delayed
go build && go install
- Add go bin dir to your PATH env if not added already. Add this line to your
.zshrc(or equivalent) if you want the go bin dir to stay in your PATH (recommended)
export PATH=$PATH:$(go env GOPATH)/bin
That's it! Enjoy ❤️


