Subscribe to bininvestx.eth
Subscribe to bininvestx.eth
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers
Are you annoyed by always spending your time selecting ‘reopen folder in wsl’? I was too, and for this reason I will share with you my solution
I want to include a new option when I right click on a folder to choose ‘Open with WSL Code’.
Access your Windows Registry search by regedit in windows search (just press windows button and type regedit).
Windows Regestry Editor After a window opens, navigate through the left keys (folders) into HKEY_CLASSES_ROOT -> Directory -> shell.
Folder schema of target folder VSCode key (as folder) is who defines what option “Open with Code”. Let’s create our WSLCode key. Right click on shell and choose new -> key. Name it as you want, i choose WSLCode. Right click on WSLCode and create a new key named command.
Left click into WSLCode and on the left screen, where it shows (default). Modify the default value to the message you want to display, something like “Open with WSL Code”. You can add a new string named “Icon” to set an icon in the options list. I set the same as VSCode.
The command key is where the computer knows what it must to execute when you click into that option, so define it as:
The argumen cd set the selected folder as current path and code call vscode.
wsl.exe --cd "%V" -- code .
You can create unique options for each distro in wsl too.
wsl -l
wsl.exe -d Ubuntu-20.04 -— code .
wsl.exe -d Debian -— code .
Are you annoyed by always spending your time selecting ‘reopen folder in wsl’? I was too, and for this reason I will share with you my solution
I want to include a new option when I right click on a folder to choose ‘Open with WSL Code’.
Access your Windows Registry search by regedit in windows search (just press windows button and type regedit).
Windows Regestry Editor After a window opens, navigate through the left keys (folders) into HKEY_CLASSES_ROOT -> Directory -> shell.
Folder schema of target folder VSCode key (as folder) is who defines what option “Open with Code”. Let’s create our WSLCode key. Right click on shell and choose new -> key. Name it as you want, i choose WSLCode. Right click on WSLCode and create a new key named command.
Left click into WSLCode and on the left screen, where it shows (default). Modify the default value to the message you want to display, something like “Open with WSL Code”. You can add a new string named “Icon” to set an icon in the options list. I set the same as VSCode.
The command key is where the computer knows what it must to execute when you click into that option, so define it as:
The argumen cd set the selected folder as current path and code call vscode.
wsl.exe --cd "%V" -- code .
You can create unique options for each distro in wsl too.
wsl -l
wsl.exe -d Ubuntu-20.04 -— code .
wsl.exe -d Debian -— code .
No activity yet