Skip to content

Instantly share code, notes, and snippets.

@mjhennig
Last active October 19, 2017 08:24
Show Gist options
  • Select an option

  • Save mjhennig/ba3b73b2c9146ad416987a4215056926 to your computer and use it in GitHub Desktop.

Select an option

Save mjhennig/ba3b73b2c9146ad416987a4215056926 to your computer and use it in GitHub Desktop.
Lock a shell terminal's location
# source or include with .${SHELL}rc
lockon ()
{
pushd ${1:-$PWD} > /dev/null;
$SHELL -c "while [ \$? -eq 0 ]; do $SHELL; done";
popd > /dev/null
}
lockoff ()
{
kill $PPID;
exit $? 2> /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment