Fix bug on cd ""

This commit is contained in:
Thomas Forgione 2024-07-31 10:01:49 +02:00
parent 6ba78c412b
commit 8af310d0a2
1 changed files with 6 additions and 1 deletions

View File

@ -5,7 +5,12 @@ if [ "$PRESERVE_SSH_CWD" = "true" ]; then
# Alias for cd: when we change directory, we write the new cwd in the file corresponding to the terminal uuid
cd() {
builtin cd "$1"
if [ -z "$1" ]; then
directory=$HOME
else
directory="$1"
fi
builtin cd "$directory"
pwd > $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd
}