From 6ba78c412b78f8d0b0b0fa5373dd4a6206ca2599 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 24 Jul 2024 11:32:23 +0200 Subject: [PATCH] No crash on space --- zsh/preserve-cwd-ssh.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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