GitShow/sindresorhus/shell-env
sindresorhus

shell-env

Get environment variables from the shell

by sindresorhus
Star on GitHubForknpm

JavaScript

87 stars20 forks8 contributorsQuiet · 5mo agoSince 2016v4.0.3MIT

Meet the team

See all 8 on GitHub →
sindresorhus
sindresorhus30 contributions
silverwind
silverwind11 contributions
rgbkrk
rgbkrk2 contributions
albinekb
albinekb1 contribution
BendingBender
BendingBender1 contribution
saltfish666
saltfish6661 contribution
Fazendaaa
Fazendaaa1 contribution
lgeiger
lgeiger1 contribution

Languages

View on GitHub →
JavaScript95.1%
TypeScript4.9%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
aritropaul
shell-env's sync function returns no outputClosedIssue

Kinda hangs my terminal too, cannot kill this even with Ctrl + C !Screenshot 2020-07-10 at 4 09 33 PM

aritropaul · 5mo ago
hughrawlinson
Fallback from Interactive ModeClosedIssue

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?

hughrawlinson · 5mo ago
ramarivera
Non-POSIX shells (Nushell, Fish) cause silent failureClosedIssue

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.*

ramarivera · 5mo ago
Structured data for AI agents

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.

·@ofershap

Replace github.com with gitshow.dev