Last 12 weeks · 0 commits
4 of 6 standards met
Hi, I'm encountering an issue where my environment isn't captured due to a zsh plugin I'm running. I run the tmux plugin for oh-my-zsh with the option turned on, which means that when is run, it opens up tmux and causes issues for non-interactive processes opening it up expecting a prompt but getting a tmux instead. I've encountered this issue with my text editor also, but was able to configure my text editor not to use interactive mode, which works for me because I only start up tmux automatically in interactive mode. I understand that in practice, people are likely to set their environments in their , so simply turning off interactive mode would not be an acceptable solution in this case. I'm wondering if you'd be open to a PR which detects whether or not the appropriate environment from running interactive mode, and if not, running non-interactive mode to see if it can gather more environment?
Problem When a user's default shell is a non-POSIX shell like Nushell or Fish, fails silently and falls back to , which in GUI applications (Electron apps) contains only the minimal macOS default PATH. Root Cause The library runs the following command against the user's default shell: This assumes: 1. The shell supports (interactive) and (login) flags 2. The shell has syntax 3. The shell's command outputs in format Nushell fails on all three: Nushell doesn't have or flags (causes parse error on ) Nushell uses , not Nushell's outputs in a different format Reproduction Impact This breaks (which depends on → ) in Electron apps for users with non-POSIX default shells. The app silently gets a minimal PATH without the user's tools (mise, nvm, homebrew, etc.). Real-world example: Dyad issue #2171 Suggested Solutions 1. Detect shell type and use appropriate syntax for each shell family 2. On macOS, fall back to which contains the GUI environment 3. Document the limitation* clearly in the README Environment macOS 15 (Sequoia) Nushell 0.107.0 shell-env 4.0.1 🤖 This issue was generated with AI assistance using Claude Opus 4.5.*
Repository: sindresorhus/shell-env. Description: Get environment variables from the shell Stars: 87, Forks: 20. Primary language: JavaScript. Languages: JavaScript (95.1%), TypeScript (4.9%). License: MIT. Latest release: v4.0.3 (5mo ago). Open PRs: 0, open issues: 0. Last activity: 5mo ago. Community health: 85%. Top contributors: sindresorhus, silverwind, rgbkrk, albinekb, BendingBender, saltfish666, Fazendaaa, lgeiger.