From bf76b59f3ce9cff2232655c9d4477286ee7adabe Mon Sep 17 00:00:00 2001 From: DannyDannyDanny Date: Thu, 11 Sep 2025 14:00:19 +0200 Subject: [PATCH] fix: macOS compatible ps flags :bug: --- nixos/fish.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/fish.nix b/nixos/fish.nix index defb961..b2f1354 100644 --- a/nixos/fish.nix +++ b/nixos/fish.nix @@ -63,7 +63,8 @@ # however this also means that nix-shell starts a bash shell unless you use `nix-shell [args] --run fish` # or run `fish` as the first command when entering nix-shell - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + # Use macOS/BSD-compatible ps flags to detect parent shell + if [[ $(ps -p "$PPID" -o comm=) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] then shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" exec ${pkgs.fish}/bin/fish $LOGIN_OPTION