Fix `brew edit` with environment filtering.
For many people `brew edit` makes use of the `EDITOR` variable to pick a sensible editor. With environment filtering enabled unless this editor is found in the default system PATH it'll fall back to e.g. `vim`. Instead, ensure that we export the original, pre-filtering `PATH` as `HOMEBREW_PATH` and use that internally to locate the editor. In future this same approach will likely be used for requirements to be able to find tools, too, and for other variables which we want to expose to Homebrew itself but not other build tools. Note that `HOMEBREW_PATH` is the same as `PATH` when build filtering hasn't been enabled.
Please register or sign in to comment