diff --git a/lib/idmgr_mod_ssh.sh b/lib/idmgr_mod_ssh.sh index 43851c2..b9a576e 100644 --- a/lib/idmgr_mod_ssh.sh +++ b/lib/idmgr_mod_ssh.sh @@ -326,7 +326,7 @@ background() { idm_ssh__agent_start() { # local socket=$1 local id=$1 - local life=5d + local life=4w local socket_dir="${XDG_RUNTIME_DIR}/ssh-agent/${id}" local socket="${socket_dir}/socket" diff --git a/shell/bash.sh b/shell/bash.sh index d0a0d8e..f16ea25 100644 --- a/shell/bash.sh +++ b/shell/bash.sh @@ -51,6 +51,13 @@ i_restore_last_id () [[ "$IDM_LAST_ID_AUTOLOAD" == 'true' ]] || return 0 + # Restore from SHELL_ID + if [[ -n "${SHELL_ID:-}" ]]; then + i enable $SHELL_ID + return + fi + + # Restore from last loaded shell local IDM_DIR_CACHE=${IDM_DIR_CACHE:-${XDG_CACHE_HOME:-~/.cache}/idmgr} local state_file=$IDM_DIR_CACHE/last_id if [ -f "$state_file" ]; then