Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows subsystem as normal user errors on all commands. #67

Open
mjarkk opened this issue Jan 25, 2019 · 3 comments
Open

Windows subsystem as normal user errors on all commands. #67

mjarkk opened this issue Jan 25, 2019 · 3 comments

Comments

@mjarkk
Copy link

mjarkk commented Jan 25, 2019

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 code

Do 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
@mjarkk
Copy link
Author

mjarkk commented Jan 25, 2019

Update this happens not only with git it happens with everything, i tried ls -a and it gave the same error:
fork/exec /usr/bin/ls: invalid arguments

@mjarkk mjarkk changed the title WSL debian as normal user git fetch, pull, push not working. WSL debian as normal user errors on all commands. Jan 25, 2019
@mjarkk mjarkk changed the title WSL debian as normal user errors on all commands. Windows subsystem as normal user errors on all commands. Jan 25, 2019
@LouisT
Copy link

LouisT commented Jun 6, 2019

It would seem as of Windows 10 version 1903, this is no longer an issue. From what I understand build 18305 has fixed it.

@mjarkk
Copy link
Author

mjarkk commented Jun 6, 2019

Great, i'll try it out again when i have access to a windows PC.
It it works i'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants