jog
jog copied to clipboard
Simple script to print the last 10 commands you ran in the current directory
jog
Print the last 10 commands you ran in the current directory

Usage
- Add this function to your
.zshrc
function zshaddhistory() {
if [[ "${1}" != ${~HISTORY_IGNORE} ]]; then
echo "${1%%$'\n'}⋮${PWD} " >> ~/.zsh_history_ext
fi
}
-
Download or copy the
jogscript from this repo and place it somewhere in your$PATH. -
Run
touch ~/.zsh_history_ext ; chmod 600 ~/.zsh_history_extto ensure that only you can read and write your history. -
Restart your current terminal sessions for changes to take effect.
exec $SHELL -
Use
jogwhenever you find yourself lost and confused.
It's not possible to retroactively store the directory in which a command was run, so this tool will only work from this point forward.
Todo List
Contributions and feature requests are welcome
- Add support for other shells: bash, fish.
- Automatically truncate
.zsh_history_extwhenHISTSIZEis surpassed