This has caused trouble in the past [1] [2]; after attempting to help Git-for-Windows avoid that problem in Vim [3] by recommendation [4], it was suggested that upstreaming the change instead would be a better solution. Indeed, this should work for more uses/editors/etc. [1]: https://public-inbox.org/git/CALnO6CDtGRRav8zK2GKi1oHTZWrHFTxZNmnOWu64-ab+oY3_Lw@xxxxxxxxxxxxxx/ [2]: https://benknoble.github.io/blog/2020/05/22/libexec-git-core-on-path/ [3]: https://github.com/git-for-windows/build-extra/pull/616 [4]: https://github.com/benknoble/Dotfiles/issues/143#issuecomment-2869525481 I haven't managed to test this on Windows, so any extra eyeballs there are greatly appreciated. I'd also appreciate suggestions to fix the memory leak. Structure: patches 1 & 2 are cleanups. In particular, patch 1 is essential to the tests in patch 4. I don't think patch 2 is strictly needed. Patch 3 refactors a little to make patch 4 take effect on all platforms. Patch 4 does the real work. D. Ben Knoble (4): t7005: sanitize test environment for subsequent tests editor: use standard strvec API to receive environment for external editors run-command: prep_childenv on all platforms drop git_exec_path() from non-Git commands' PATH builtin/commit.c | 2 +- editor.c | 10 ++++----- editor.h | 7 +++--- run-command.c | 55 ++++++++++++++++++++++++++++++++++++++++++----- t/t7005-editor.sh | 18 +++++++++++++--- 5 files changed, 75 insertions(+), 17 deletions(-) base-commit: 7a1d2bd0a596f42a8a7a68d55577967bb454fec0 -- 2.48.1