Unexport CMD_DURATION #1896
Merged
Unexport CMD_DURATION #1896
Conversation
Valid uses of this environment variable don't really include passing it to subsequent child processes. I confirmed the fix with: function fish_prompt echo "cmd duration [$CMD_DURATION] " end cmd duration [0] sleep 2 cmd duration [2002]
bhamiltoncx
referenced
this pull request
Jan 16, 2015
This will need a note in the release notes, although it seems unlikely that anyone is depending on this behaviour. |
In theory, someone could have a fish prompt implemented in different programming language using environment variable, but I would consider it unlikely (quick search on GitHub has shown one prompt not written in fish shell using |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Valid uses of the
CMD_DURATION
environment variable don't seem to include passingit to subsequent child processes.
I work on the Buck build system at Facebook (http://facebook.github.io/buck/). One of Buck's features is to discard its cache if anything in the calling environment has changed since the last run:
https://github.com/facebook/buck/blob/master/src/com/facebook/buck/parser/Parser.java#L950
For all shells except
fish
, this is no problem. However, sincefish
exportsCMD_DURATION
to all sub-processes with a different value each time, Buck always discards its cache between runs, so it performs terribly.I confirmed the variable is still available inside the shell by running: