WSL-Context-Menu-Manager
WSL-Context-Menu-Manager copied to clipboard
Manages the context menu for your Linux tools in WSL/WSL2 for Windows.
Context Menu Manager for WSL
Bothered to open WSL everytime?
Table of Contents
- General Info
- Features
- How to Get
- How to Use
- To add to context menu
- To delete from context menu
- Using Custom Icon
- About Environment Variables

Adding Vim to Context Menu

Deleting Vim from Context Menu

Adding Emacs to Context Menu
General Info
WSL Context Menu Manager utilizes Windows' context menu for Linux tools with the ease of use. Although Windows specifies that file performance across the Windows and Linux operating systems is faster with WSL 1, some may still want to achieve that usability with WSL 2.
Features
- Opening all files
- Opening current directory
- Custom icons in the context menu
- GUI application support for WSL 2
- Environment variables support
- Custom launch arguments
How to Get
- You can clone repository to your local and begin to use. There you can compile
.cppfiles inbinfolder yourself if you want. - You can also get clean version by clicking here!
How to Use
Before adding any tool to your context menu, decide where to put WSL Context Menu Manager. Don't change the directory name or location without deleting all the tools. You can always manually delete though.
To add to context menu
- Run
add_to_context_menu.bat. - It will ask for admin privileges to manage registries in the system from Command Prompt. You'll be able to view context of last added registry. You can check the general content of constructed register in the screenshot down below.
- Answer the questions appropriately.
First Question: What is the launch command in WSL?
The idea behind this, take the launch command user gave and append launch path with a blank space at the end. Creating a generic script for all the tools is hard. My assumption is, tools are capable of undestanding the string all alone at the end of launch command.
If your tool doesn't understand the path at the end, you may need to use a specific command line option. Use that option at the end of your launch command. Leave its value empty because launch path will be appended to end of your launch command.
You can always go to the scripts folder and edit the script of your tool manually to meet your needs.
Second Question: Is this a GUI app?
If you use a X Server for your app, you need to answer with y. Otherwise it shouldn't matter.
Possible Adding Scenario
General Content of Constructed Register
To delete from context menu
- Run
delete_from_context_menu.bat. - It will ask for admin privileges to manage registries in the system from Command Prompt.
- Answer the questions appropriately.
Answer to the first question What is the app name you want to delete?: should be identical to the first word of launch command you wrote while adding to context menu.
Possible Deleting Scenario
Using custom icon
- Put your
.icofile toiconsfolder in this way:XXX.ico. XXX is the name of the app you are going to give while adding that app to context menu. XXX must be identical with your answer. - You must do this before adding to context menu.
- Sometimes if you replace your new
.icofile with the existed name, Windows shows the old icon. You need to run this codeie4uinit.exe -showor you can restart your computer.
About Environment Variables
WSL doesn't see your exported variables within the outer terminal. Which means you can't launch your app in Linux with the command line arguments, as you normally do in Linux if you exported some variable for it, while starting WSL.
If you export something to launch, then follow these instructions.
- Open
Edit environment variables for your accountin Windows.
- If you're exporting your variable to your
PATHvariable,- Add an environment variable named
WSLPATHto Windows. - Set its value to what you want to export in Linux.
- If you want to export multiple values to your
PATH, seperate them with:.
- Add an environment variable named
- If you're exporting a variable,
- Add an environment variable named
WSLEXPORT. - Set its value to what you want to export in Linux.
- If you want to export multiple values to your
PATH, seperate them with, blank space.
- Add an environment variable named
Environment Variables