fix bug in samedir script (#1127)

samedir didn't work properly when the shell was opened inside lf using the w keybinding, now its fixed.
This commit is contained in:
Rokosun 2022-06-24 03:35:02 +00:00 committed by GitHub
parent 09ca9e57ac
commit f03efe97d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p") PID=$(xprop -id "$(xprop -root | xprop -root | sed -n "/_NET_ACTIVE_WINDOW/ s/^.*# // p")" | sed -n "/PID/ s/^.*= // p")
PID="$(pstree -lpA "$PID")" PID="$(pstree -lpA "$PID")"
PID="${PID##*(}" PID="${PID##*"${SHELL##*/}"(}"
PID="${PID%)}" PID="${PID%%)*}"
cd "$(readlink /proc/"$PID"/cwd)" || return 1 cd "$(readlink /proc/"$PID"/cwd)" || return 1
"$TERMINAL" "$TERMINAL"