-
-
Couldn't load subscription status.
- Fork 260
Description
Currently i'm trying to solve this issue: jesseduffield/lazygit#360
The short version of this issue is that when we use this package to run Git commands it errors on the Windows linux based subsystem as normal user with this error:
fork/exec /usr/bin/git: invalid arguments
Here is the code we use to do a git pull:
cmd := exec.Command("git", "pull")
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, "LANG=en_US.UTF-8", "LC_ALL=en_US.UTF-8")
var stderr bytes.Buffer
cmd.Stderr = &stderr
ptmx, err := pty.Start(cmd)
if err != nil {
return err // IT ERRORS HERE
}
// Other codeDo you know what the problem is here?
From other Github issues about the windows subsystem I've noticed that this might be related to the windows subsystem kernel.
Although there is one wired thing.. If the binary gets ran as root it works completely fine.
Do you have any idea why this happens or what might cause this.
Here are some other details:
- OS: Windows subsystem Debian based
- When running the commands with
bash -c "git pull"also gives the same error (sh does the same thing) - When running as root it works fine
- git fetch, pull, push all work perfectly fine when ran in the normal shell and without this package.
- We use a fork of your package that is up to date with yours but with a different way of error reporting, here are the changes: jesseduffield@02db52c
- This happens on all subsystems: Debian, OpenSuse, Ubuntu, etc