microsoft / microsoft/WSL

Reliable way to set a WSL2 application to be the default for opening a filetype

Open
#7,546 5 comments 4 reactions 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

Is your feature request related to a problem? Please describe.
I use Neovim (Vim) as my text editor. It is installed in a WSL2 Ubuntu 20.04 instance. I would like it to be my default editor in windows for text files (e.g. If one double clicks a text file in explorer). I create .bat files to achieve, but they came seeming to break when they are windows updates.

Describe the solution you'd like
Someway to asscoiate file types with WSL applications, and correctly pass the file paths to them.

Describe alternatives you've considered
Long convoluded bash scripts, that work then stop working. e.g. if you require a double quote in the bash command, need to escape it with \\"^""

Additional context
Here is the script I created https://stackoverflow.com/a/62876682/5506400 (been viewed about 1k times).

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

The issue names no repository files, tests, or implementation entry point; it provides a Stack Overflow script as context. Start by reviewing that script and how WSL2 applications integrate with Windows file associations and path passing. Done means a supported, reliable association that opens the file type in the WSL application.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.