Prevent bug when PARENT_TERMINAL is empty

This commit is contained in:
Thomas Forgione 2024-06-24 14:09:50 +02:00
parent feebba4e12
commit 1facb0079a
1 changed files with 8 additions and 5 deletions

View File

@ -25,12 +25,15 @@ if [ "$PRESERVE_SSH_CWD" = "true" ]; then
fi fi
# Copy state for new terminal # Copy state for new terminal
if [ -f $HOME/.config/terminalscwd/$PARENT_TERMINAL.cwd ]; then if [ ! -z $PARENT_TERMINAL ]; then
cp $HOME/.config/terminalscwd/$PARENT_TERMINAL.cwd $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd if [ -f $HOME/.config/terminalscwd/$PARENT_TERMINAL.cwd ]; then
fi cp $HOME/.config/terminalscwd/$PARENT_TERMINAL.cwd $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd
fi
if [ -f $HOME/.config/terminalscwd/$PARENT_TERMINAL.ssh ]; then if [ -f $HOME/.config/terminalscwd/$PARENT_TERMINAL.ssh ]; then
cp $HOME/.config/terminalscwd/$PARENT_TERMINAL.ssh $HOME/.config/terminalscwd/$TERMINAL_UUID.ssh echo $HOME/.config/terminalscwd/$PARENT_TERMINAL.ssh $HOME/.config/terminalscwd/$TERMINAL_UUID.ssh
cp $HOME/.config/terminalscwd/$PARENT_TERMINAL.ssh $HOME/.config/terminalscwd/$TERMINAL_UUID.ssh
fi
fi fi
# When we're done, delete the uuid files # When we're done, delete the uuid files