Better remote cd

This commit is contained in:
Thomas Avé 2024-04-01 01:25:46 +02:00
parent 7310122d11
commit 7a90969e01
3 changed files with 5 additions and 5 deletions

View File

@ -5,8 +5,9 @@
##########################################
set -o pipefail
source "$XDG_CONFIG_HOME"/zsh/secrets.sh
export XDG_RUNTIME_DIR=/run/user/1000
export XDG_CONFIG_HOME=/home/server/.config
source "$XDG_CONFIG_HOME"/zsh/secrets.sh
##########################################
# Create sqlite3 backup for Vaultwarden #

View File

@ -1,5 +1,6 @@
#!/bin/bash
export XDG_CONFIG_HOME=/home/server/.config
source "$XDG_CONFIG_HOME"/zsh/secrets.sh
for _ in {1..2}; do

View File

@ -1,6 +1,4 @@
if [[ -z "${XDG_CONFIG_HOME}" ]]; then
source ~/.profile
fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
@ -162,7 +160,7 @@ function zvm_after_init() {
if [ "$REMOTE_PATH" != "" ]; then
cd "$REMOTE_PATH"
elif [ "$PREVIOUS_SESSION_ID" != "" ]; then
cd $(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)
cd "$(readlink -e /proc/$(cat /tmp/ssh_sessions/$PREVIOUS_SESSION_ID)/cwd)"
fi
}