Support j

This commit is contained in:
Thomas Forgione 2024-09-07 21:06:30 +02:00
parent f7b4e36cc3
commit 9de770c4bc
1 changed files with 12 additions and 1 deletions

View File

@ -7,10 +7,21 @@ if [ "$PRESERVE_SSH_CWD" = "true" ]; then
cd() { cd() {
if [ -z "$1" ]; then if [ -z "$1" ]; then
directory=$HOME directory=$HOME
elif [[ "$1" == "-P" ]] && [ -z $2 ]; then
directory="$HOME"
option="$1"
elif [[ "$1" == "-P" ]]; then
directory="$2"
option="$1"
else else
directory="$1" directory="$1"
fi fi
if [ -z "$option" ]; then
builtin cd "$directory" builtin cd "$directory"
else
builtin cd "$option" "$directory"
fi
pwd > $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd pwd > $HOME/.config/terminalscwd/$TERMINAL_UUID.cwd
} }