Updated 4/22/2019! My old config stopped working…

cmder integrated context menu customization into the Settings panel and I was able to get Git Bash to work, but Windows Ubuntu (aka WSL) kept opening in my $HOME directory although I wanted it to open in a specific directory after right clicking inside of a specific folder and selecting “Ubuntu Here”. After a lot of trial and error I got this to work.

Old setting

In Settings > Startup > Tasks, I already had a task for using Ubuntu labeled {ubuntu} set this way (shown through the screenshot):

Image of cmder settings to open WSL from the context menu
Old Settings in cmder

In Settings > Integration: I’d already created a menu item called “Ubuntu Here” and with this setting (which works just find for git bash):

  • Command: {ubuntu} -cur_console:n:d:”%V”
New setting

In Startup > Tasks, I created a new task and labeled it {wsl::here} and added this command (you can label yours whatever you’d like): %windir%\system32\wsl.exe -new_console

Then back in Integration settings: I changed the command for “Ubuntu Here” to just point to that newly created startup task: Command: {wsl::here}

Make sure you select the “Register” button before saving. If you don’t, it won’t actually save.

My settings panel screenshots are below:
A screenshot of my cmder settings to open WSL in a specific directory from the context menu
Updated cmder settings for WSL
A screenshot of my cmder settings to open WSL in a specific directory from the context menu
A screenshot of my cmder settings to open WSL in a specific directory from the context menu

This worked, but I’m open to other ideas.

I went through some GH tickets and an extensive google search and couldn’t find anything that answered my questions but good ole time wasting trial & error worked wonders.

Bonus: my settings panel screenshots are below:

And this is my setting for opening WSL from cmder in the Linux home directory instead of the Windows one.

cmder settings for opening in the linux home directory
cmder settings for opening in the linux home directory

2 comments on “How to open Windows Ubuntu (WSL) in cmder from a specific directory

Leave a Reply

Your email address will not be published. Required fields are marked *