feat(starship): name the direnv environment in the prompt - #88
Open
mauroporras wants to merge 3 commits into
Open
mauroporras wants to merge 3 commits into
mauroporras wants to merge 3 commits into
Conversation
A shell wired to production is indistinguishable from one wired to a scratch database until after the command runs. Read PROJECT_ENV, which direnv exports on the way into a directory and drops on the way out, and render it as its own prompt segment. Two custom modules rather than one env_var module because the styling has to depend on the value: env_var renders every environment identically, which defeats the point. The when conditions are exhaustive and mutually exclusive, so exactly one ever renders, and both run sh builtins only (~1ms per prompt, well inside command_timeout). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFcPixS6WQDbkFXPo2Uhx2
Gives the prompt's environment indicator something to read in the development/production example shells, and documents the contract at the place someone copies from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFcPixS6WQDbkFXPo2Uhx2
Covers what the segment means, where PROJECT_ENV comes from, and why the variable isn't named ENVIRONMENT or APP_ENV. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QFcPixS6WQDbkFXPo2Uhx2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A shell wired to production is indistinguishable from one wired to a
scratch database until after the command runs. Read PROJECT_ENV, which
direnv exports on the way into a directory and drops on the way out, and
render it as its own prompt segment.
Two custom modules rather than one env_var module because the styling has
to depend on the value: env_var renders every environment identically,
which defeats the point. The when conditions are exhaustive and mutually
exclusive, so exactly one ever renders, and both run sh builtins only
(~1ms per prompt, well inside command_timeout).
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01QFcPixS6WQDbkFXPo2Uhx2