diff --git a/zsh/preserve-cwd-ssh.zsh b/zsh/preserve-cwd-ssh.zsh index 88a389c..e290b28 100644 --- a/zsh/preserve-cwd-ssh.zsh +++ b/zsh/preserve-cwd-ssh.zsh @@ -5,7 +5,7 @@ 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 + builtin cd "$1" pwd > $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd } @@ -47,7 +47,7 @@ if [ "$PRESERVE_SSH_CWD" = "true" ]; then if [ -f $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd ]; then # Go the the right directory - cd $(cat $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd) + cd "$(cat $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd)" else