Skip to content

Add support for WSL shell on Windows 10 - #4657

Closed
JordanMussi wants to merge 4 commits into
desktop:masterfrom
JordanMussi:gh-4641
Closed

JordanMussi wants to merge 4 commits into
desktop:masterfrom
JordanMussi:gh-4641

Conversation

@JordanMussi

Copy link
Copy Markdown
Contributor

Fixes #4641

Currently I'm relying on C:\Windows\System32 being on the path (reasonable assumption 😉) because passing C:\Windows\System32\wsl.exe to spawn doesn't seem to actually launch anything (same for bash.exe).

'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\Notifications\\OptionalFeatures\\Microsoft-Windows-Subsystem-Linux'
)

// TODO - does this check need to be more specific?

This comment was marked as spam.

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member

Currently I'm relying on C:\Windows\System32 being on the path (reasonable assumption 😉)

I've been caught by this a couple of times, and I think you're fine to do the same trick as #4085 because some people do change their PATH around.

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like where this is heading @JordanMussi!

'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\Notifications\\OptionalFeatures\\Microsoft-Windows-Subsystem-Linux'
)

// TODO - does this check need to be more specific?

This comment was marked as spam.

}

// Installed, but check for executable on disk as well!
return true

This comment was marked as spam.

return null
}

const path = Path.join('C:\\Windows\\System32', 'wsl.exe')

This comment was marked as spam.

return null
}

const path = Path.join('C:\\Windows\\System32', 'bash.exe')

This comment was marked as spam.

PowerShellCore = 'PowerShell Core',
Hyper = 'Hyper',
GitBash = 'Git Bash',
Wsl = 'WSL',

This comment was marked as spam.

This comment was marked as spam.

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 10, 2018
@shiftkey shiftkey self-assigned this May 10, 2018
@shiftkey shiftkey removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 24, 2018
@shiftkey shiftkey removed their assignment May 24, 2018
@shiftkey shiftkey added the integrations Issues related to editor and shell integrations that ship in Desktop label Jul 3, 2018
@shiftkey shiftkey self-assigned this Jul 9, 2018
@shiftkey

Copy link
Copy Markdown
Member

@JordanMussi this has sat for a while with pending feedback. Is this something you're interested in picking up again to try and wrap up?

@shiftkey shiftkey removed their assignment Jul 12, 2018
@dlloyd123

Copy link
Copy Markdown

I noticed the PR seems to have gone cold, and wondered if you are interested in another implementation I have of this. I did this a while ago in my spare time but left it as I saw someone had already done it (this PR). Being as this seems to have gone cold, I have a bit of a more complete solution (covering all distro's and calling the command line wslconfig to parse out configured distros). Let me know if you want this? I would create a branch and PR but I think I would need permission(s) to do so.

win32.zip

@JordanMussi

Copy link
Copy Markdown
Contributor Author

Hi @shiftkey I’ve been rather busy lately and am currently away until next week. I’d definitely like to get this wrapped up when I’m back.

@dlloyd123 just fork the desktop/desktop repository and push your changes to your fork, would be interesting to see what you’ve done differently!

@shiftkey

Copy link
Copy Markdown
Member

@JordanMussi no problem, thanks for the update!

@dlloyd123 feel free to follow the advice from @JordanMussi and publish a branch on your fork - this will help us easily see and compare the changes to what's currently here!

@dlloyd123

Copy link
Copy Markdown

no problem will do so in a bit

@dlloyd123

Copy link
Copy Markdown

Forked a copy and created branch and a PR into my master for you to look at. Happy to amend anything if you wish to use it, or feel free to lift anything from it for this PR.

@JordanMussi @shiftkey

https://github.com/dlloyd123/desktop/pull/1

@shiftkey

Copy link
Copy Markdown
Member

@JordanMussi I'm going to close this out for now to help keep our outstanding PR queue under control, but feel free to comment here when you're back and have time to wrap this up.

@dlloyd123 if you're keen to see this land, feel free to open your own PR that either builds upon this work or does it a different way.

@shiftkey shiftkey closed this Aug 10, 2018
@dlloyd123

Copy link
Copy Markdown

Sure ill raise a PR in the next few days, i will have to re-test locally to make sure any new changes havent affected this, and it all builds/passes tests etc.

@LinqLover

Copy link
Copy Markdown

Hi, what is the current state of this issue? Can I use GitHub Desktop to control git installed within wsl?

@shiftkey

Copy link
Copy Markdown
Member

@LinqLover no, GitHub Desktop uses a version of Git that's embedded in the app.

We added support for opening a WSL shell from within the app in #7821, which is available on the beta channel if you'd like to test it out and provide feedback.

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

Labels

integrations Issues related to editor and shell integrations that ship in Desktop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants