Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Request: Git command inherit Neovim's environment variables #9

Open
xlucn opened this issue Dec 23, 2022 · 0 comments
Open

Request: Git command inherit Neovim's environment variables #9

xlucn opened this issue Dec 23, 2022 · 0 comments

Comments

@xlucn
Copy link

xlucn commented Dec 23, 2022

Problem:
I have some use cases where I want to customize git behavior through either user configuration file or environment variables. Then I found git command spawned by "dep" (through vim.loop.spawn) is not affected by any of those methods. After some digging, I found the environment of the git command is basically empty (by looking at /proc/[pid of git command]/environ file). Thus it's ignoring environment variables, and also ignoring user configuration due to lack of $HOME definition.

(The use case is that I would like to use proxy for git, through http.proxy setting or external commands like proxychains)

Expected:
Git command inherits whatever environment variables Neovim has.

I hope this does not require too much extra work for you, possibly is there another API to do this automatically?

xlucn added a commit to xlucn/dep that referenced this issue Dec 24, 2022
Trying to address chiyadev#7 and chiyadev#9.
`vim.loop.spawn` has two limitations:
- processes does not get killed when exiting neovim
- processes does not inherit neovim's environment variables

`jobstart` happens to workaround these two limitations by default.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant