Skip to content

Instantly share code, notes, and snippets.

@Zantier
Last active April 11, 2024 09:08
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save Zantier/692fd3e1a28d54708e95921de9b27e67 to your computer and use it in GitHub Desktop.
Save Zantier/692fd3e1a28d54708e95921de9b27e67 to your computer and use it in GitHub Desktop.
Registry file: Add WSL Ubuntu Bash to the context menu of folders in File Explorer.
Windows Registry Editor Version 5.00
; Delete directories under HKEY_CURRENT_USER\Console, then run this
; Examples: https://gist.github.com/P4/4245793
[HKEY_CURRENT_USER\Console]
"WindowAlpha"=dword:000000cd
"DefaultBackground"=dword:00000000
; black dgray
"ColorTable00"=dword:00141414
"ColorTable08"=dword:00808080
; blue lblue
"ColorTable01"=dword:00800000
"ColorTable09"=dword:00ff4040
; green lgreen
"ColorTable02"=dword:00008000
"ColorTable10"=dword:0000ff00
; cyan lcyan
"ColorTable03"=dword:00808000
"ColorTable11"=dword:00ffff00
; red lred
"ColorTable04"=dword:000000a0
"ColorTable12"=dword:000000ff
; magenta lmagenta
"ColorTable05"=dword:00800080
"ColorTable13"=dword:00ff00ff
; yellow lyellow
"ColorTable06"=dword:00008080
"ColorTable14"=dword:0000ffff
; lgray white
"ColorTable07"=dword:00c0c0c0
"ColorTable15"=dword:00ffffff
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\shell\ubuntu_bash_here]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\ubuntu_bash_here]
Windows Registry Editor Version 5.00
; Add WSL Ubuntu Bash to the context menu of folders in File Explorer.
; Setup: Use program "everything" to find wsl.ico, and copy it to %userprofile%.
[-HKEY_CLASSES_ROOT\Directory\shell\ubuntu_bash_here]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\ubuntu_bash_here]
[HKEY_CLASSES_ROOT\Directory\shell\ubuntu_bash_here]
@="ba&sh"
"Icon"="%userprofile%\\wsl.ico"
[HKEY_CLASSES_ROOT\Directory\shell\ubuntu_bash_here\command]
@="wsl cd \"$(wslpath \"%L\")\" && bash"
[HKEY_CLASSES_ROOT\Directory\Background\shell\ubuntu_bash_here]
@="ba&sh"
"Icon"="%userprofile%\\wsl.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\ubuntu_bash_here\command]
@="wsl"
@meaLuda
Copy link

meaLuda commented Jul 23, 2023

thank you brother for taking the time to do this.

@Tayumakio
Copy link

If anyone wants to use powershell instead of cmd for supporting some symbols by default, you can change the commands in that reg file to powershell.exe -noexit -command "& wsl.exe --cd '%V'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment