microsoft / microsoft/WSL

Open With not working for scripts

Open
#1,078 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

When I "open with" a shell script with Bash, I get this error message:

/bin/bash: D:\Path\To\Scripts\dostuff.sh: No such file or directory

Which is understandable, because Linux uses a different way to indicate paths.

Expected results

I'd expect it (not sure what "it" would be) to convert the supplied path to a path that is usable for bash, e.g.
D:\Path\To\Scripts\dostuff.sh -> /mnt/d/Path/To/Scripts/dostuff.sh

Steps to repro

  1. Make sure you've got a shell script (a .sh file). Any will do.
  2. Right click -> Open With -> Choose another app
  3. More apps -> scroll down -> Look for another app on this pc
  4. Type C:\Windows\system32\bash.exe (or whereever your Windows install is, you know the drill)

Now Bash will open very briefly with the above error message. Steps 2 to 4 can now be replaced with a simple doubleclick on a shell script, still resulting in the same error message.

Windows 10.0.14393 x64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue through the reported Open With flow using C:\Windows\system32\bash.exe and a .sh file, then inspect the launcher entry point that passes the Windows path to Bash. Done means the script opens successfully with a usable WSL path such as /mnt/d/Path/To/Scripts/dostuff.sh; no repository file or test is named, so locating the implementation and coverage requires project research.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.