Last active
October 19, 2017 08:24
-
-
Save mjhennig/ba3b73b2c9146ad416987a4215056926 to your computer and use it in GitHub Desktop.
Lock a shell terminal's location
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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