From 3c345a05670b106f369129a560a1abef8a29284c Mon Sep 17 00:00:00 2001 From: KMohZaid <68484509+KMohZaid@users.noreply.github.com> Date: Fri, 5 Jun 2026 17:41:05 -0700 Subject: [PATCH] fix active terminal cwd finder logic Before it was just assuming last spawn is our cwd but it's not always true --- bin/omarchy-cmd-terminal-cwd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/omarchy-cmd-terminal-cwd b/bin/omarchy-cmd-terminal-cwd index 88da9a69bc..ec6c3dddda 100755 --- a/bin/omarchy-cmd-terminal-cwd +++ b/bin/omarchy-cmd-terminal-cwd @@ -4,7 +4,7 @@ # omarchy:hidden=true terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}') -shell_pid=$(pgrep -P "$terminal_pid" | tail -n1) +shell_pid=$(ps --ppid "$terminal_pid" -o pid=,tty= | awk '$2 != "?" {print $1}' | tail -n1) if [[ -n $shell_pid ]]; then cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null)