paxtonhare / demo-magic

A handy shell script that enables you to write repeatable demos in a bash environment.
MIT License
1.67k stars 213 forks source link

Suggestion command for print+eval+nowait #19

Closed alex0ptr closed 4 years ago

alex0ptr commented 4 years ago

Thanks for the cool script.

I wanted a few commands to execute directly. The suggested option in the Readme using wait however causes the cursor on my shell to jump to the next line without prompt. This breaks the illusion of me typing. Also I didn't really like that I had to put a wait after each command when I wanted to opt in for NO_WAIT. Hence I defined a function:

# print and execute immediately
function pei {
    NO_WAIT=true pe $1
}

# usage
pei "cd agilebank" 

What do you think, could this be a nice addition? I'm happy to provide a pull request with updated docs.

paxtonhare commented 4 years ago

@alex0ptr I went ahead and added the feature. I figure too much time had passed to bother you with doing it. Thanks for the suggestion!