question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for WSL Bash on Windows 10

See original GitHub issue

Is your feature request related to a problem? Please describe. Windows Subsystem for Linux has available bash environment that’s available as an optional extra in recent versions of Windows 10.

screen shot 2018-05-09 at 2 08 05 pm

It would be nice to light this up as an option in Desktop and let users choose this shell.

Describe the solution you’d like The checks that Desktop need to perform should be added into app/src/lib/shells/win32.ts and we have documentation outlining how to add support for additional shells.

The high-level steps for looking this up are basically:

  • are you on Windows 10? If not, return false
  • Have you enabled WSL? This seems to be the magic registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Notifications\OptionalFeatures\Microsoft-Windows-Subsystem-Linux and it contains these values:

If not found inthe registry, return false

  • Lastly, does C:\Windows\System32\bash.exe exist on disk. That seems to be enough for an entry point but it’d also be nice to be able to detect that you have a Linux distro installed (otherwise you would see a prompt to visit the store and install, which is fine).

We need to ensure that it launches in the user’s repository, and I think we can lean on cwd like this:

return spawn(pathToBashExe, [ ], {
  shell: true,
  cwd: path,
})

EDIT: @JordanMussi added some extra context from their setup below - feel free to use that alongside the above rules.

Teachability, Documentation, Adoption, Migration Strategy

This should all just work, but I’m not sure on the right label for this shell to prevent it from being confused with Git Bash. In the start menu you search on the Linux distro you have, which means support for multiple distros is possible - maybe that’s a stretch goal for this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tierninhocommented, Jun 14, 2019

@ADustyOldMuffin Go for it! ✨

0reactions
ADustyOldMuffincommented, Jun 14, 2019

@shiftkey I’d be interested in taking this over since it seems to be almost done and in need of a owner.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install Linux on Windows with WSL - Microsoft Learn
Install Windows Subsystem for Linux with the command, wsl --install. Use a Bash terminal on your Windows machine run by your preferred Linux...
Read more >
How to Enable the Linux Bash Shell on Windows 10 [WSL 2]
1. First of all, we need to enable the “Windows Subsystem for Linux” feature. To do so, press the Windows key once and...
Read more >
How to Install and Use the Linux Bash Shell on Windows 10
First, enable the Windows Subsystem for Linux (WSL) from the Features window or via the "wsl --install" command. After rebooting your PC, ...
Read more >
How to Install WSL 2 on Windows 10 (Updated) - OMG! Ubuntu!
Install WSL 2 on Windows 10 · Step 1. Enable WSL. Regardless of which version of WSL you want to use you first...
Read more >
How to install Linux WSL2 on Windows 10 and Windows 11
WSL2 is a significant upgrade over the initial version of the Windows Subsystem for Linux but installing it requires a bit of process....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found