From 9f49f869a3652cb29008683f27d2c1644b7b4eb4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 22 Aug 2025 17:22:37 +0200 Subject: [PATCH] Fix to protect it for the first launch --- bin/omarchy-cmd-terminal-cwd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-cmd-terminal-cwd b/bin/omarchy-cmd-terminal-cwd index 86143d01..6062b68f 100755 --- a/bin/omarchy-cmd-terminal-cwd +++ b/bin/omarchy-cmd-terminal-cwd @@ -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