Skip to content

Instantly share code, notes, and snippets.

@udkyo
Created June 2, 2020 08:06
Show Gist options
  • Save udkyo/119e2ab73423fdbf961b8846c0b284a3 to your computer and use it in GitHub Desktop.
Save udkyo/119e2ab73423fdbf961b8846c0b284a3 to your computer and use it in GitHub Desktop.
VSCode terminal history persistence helper
function hist {
[ ! -d ~/.history ] && mkdir ~/.history
chmod 700 ~/.history
name="history$(pwd | sed 's/\//-/g')"
echo "Using history file $name"
HISTFILE=~/.history/$name
HISTSIZE=4096
SAVEHIST=4096
setopt appendhistory
fc -R
}
hist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment