WSL Interoperability: Open Windows 10 applications w/ Bash (Windows Linux Subsystem)

I'm running the latest Windows Subsystem for Linux Build 14986 (Ubuntu 16.04 - Xenial), and I want the ability to open up Window 10 applications directly from bash prompt by typing a command.

Also, it would be great if I could open up Linux files the same way (vice versa) w/ Visual Studio Code (Windows Application). Is this possible now w/ WSL Interoperability? This new feature was released in Build 14951, but I'm unsure of it's full capability.


Example

Typing code . inside the bash prompt would open up the www folder in my default editor (Visual Studio Code).

enter image description here

13

1 Answer

I use Atom as my code editor. Typing atom somefile.py opens the Python file in Atom regardless of whether or not I type it in Windows or Linux on the subsystem.

It sounds like you want this same functionality, but instead of typing atom, you want to have your own custom command.

This can be done with aliases. For example, if I type alias code='atom $1' into the Linux bash, and then type code somefile.py, it opens in Atom.

These aliases will disappear once you close the bash window, so most people instead put them in a file called ~/.bashrc which is automatically run when you open a new Linux bash window, so your command will be ready to use all the time.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like