Fix to protect it for the first launch

This commit is contained in:
David Heinemeier Hansson 2025-08-22 17:22:37 +02:00
parent c3b58bc773
commit 9f49f869a3

View File

@ -3,4 +3,9 @@
# Go from current active terminal to its child shell process and run cwd there
terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}')
shell_pid=$(pgrep -P "$terminal_pid" | head -n1)
readlink -f "/proc/$shell_pid/cwd" 2>/dev/null || echo "$HOME"
if [[ -n $shell_pid ]]; then
readlink -f "/proc/$shell_pid/cwd" 2>/dev/null
else
echo "$HOME"
fi