From 8eaea782abefb0df056836e9c8e75584422366b0 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:04:27 +0100 Subject: [PATCH] shell stuff for zed --- modules/common/shell/0_nushell.nu | 4 +++- modules/common/shell/default.nix | 17 +++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/common/shell/0_nushell.nu b/modules/common/shell/0_nushell.nu index b49b6d5..755e37f 100644 --- a/modules/common/shell/0_nushell.nu +++ b/modules/common/shell/0_nushell.nu @@ -461,4 +461,6 @@ def --wrapped jc [...arguments: string@"nu-complete jc"]: [any -> table, any -> } } -greeting +if $nu.is-interactive { + greeting +} diff --git a/modules/common/shell/default.nix b/modules/common/shell/default.nix index eafb5da..86f5cf2 100644 --- a/modules/common/shell/default.nix +++ b/modules/common/shell/default.nix @@ -69,7 +69,9 @@ in config' = homeArgs.config; nuExecCondition = if config.isDarwin then - ''[ -z "$INTELLIJ_ENVIRONMENT_READER" ] && [ -z "$skip" ]'' + '' + [[ $- == *i* ]] && [ -z "$skip" ] && [ -t 1 ] + '' else ''[ -z "$INTELLIJ_ENVIRONMENT_READER" ] && [ -z "$skip" ] && [ -z "$SSH_TTY" ]''; in @@ -79,12 +81,15 @@ in export PATH="$HOME/.local/bin:/run/wrappers/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/etc/profiles/per-user/$USER/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin''${PATH:+:}''${PATH}" source ${config'.home.sessionVariablesPackage}/etc/profile.d/hm-session-vars.sh - if ${nuExecCondition}; then - SHELL='${lib.getExe <| lib.head config'.shellsByPriority}' exec "$SHELL" - fi - ''; + if ${nuExecCondition}; then + parent_cmd="$(ps -o command= -p "$PPID" 2>/dev/null || true)" + case "$parent_cmd" in + *"/Applications/Zed.app/Contents/MacOS/zed --printenv"*) return ;; + esac + SHELL='${lib.getExe <| lib.head config'.shellsByPriority}' exec "$SHELL" + fi + ''; } ) - ]; }