Skip to content

Instantly share code, notes, and snippets.

@morulus
Created May 7, 2020 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morulus/5848b8a9af6c1794191330ac96faa2ba to your computer and use it in GitHub Desktop.
Save morulus/5848b8a9af6c1794191330ac96faa2ba to your computer and use it in GitHub Desktop.
Kill subshell process on press any key (bash)
pid=$(sleep 1000 & echo "$PPID") &
npx -q press-any-key "Press any key to stop subshell" && kill "$pid";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment