From 72c2cb3a9e083e579cba2334832355f750b17017 Mon Sep 17 00:00:00 2001 From: sev Date: Thu, 26 Dec 2024 09:07:14 -0600 Subject: [PATCH] zsh: fix zcleanup removing live dirs used ps -a instead of -A (busybox ps always returns all pids so I didn't notice) and use basename of comm since it can be a full path on some systems --- etc/zsh/.zshenv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/zsh/.zshenv b/etc/zsh/.zshenv index 0b4699c..2d419ee 100644 --- a/etc/zsh/.zshenv +++ b/etc/zsh/.zshenv @@ -7,8 +7,9 @@ function _sev_zcleanup { function _sev_checkpid { # return 1 if pid is a zsh process that isn't us + # NOTE: would love to use ps -p but busybox doesnt support it :DDD [[ $$ -eq $1 ]] || { ! kill -0 $1 2>/dev/null || - [[ $(ps -aopid=,comm= | awk "\$1 == $1 { print \$2 }") != zsh ]] } + [[ ${$(ps -Aopid=,comm= | awk '$1 == '$1' {print $2}'):t} != zsh ]] } } # gpg forwarding if [[ -d $_sev_gpg_forward_dir && ( -z $1 || $1 == 'gpg-forward' ) ]] { -- 2.48.1