$ | >

Let us right click "open bash here" from explorer

Similar to how you can shift+right click and "open command window here" while viewing a folder through explorer. It would be nice to have "open bash here" as well.

862 votes
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)

We’ll send you updates on this idea

Matt shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

17 comments

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...
  • WSLUser commented  ·   ·  Flag as inappropriate

    Well they actually implemented something simpler. As of build 17666 (the devil is trying to seduce us haha): "Add explorer context menu to launch WSL [GH 437, 603, 1836]. To use hold shift and right-click when in an explorer window."

  • WSLUser commented  ·   ·  Flag as inappropriate

    It should be able to do wsl.exe which will bring up the default distro. You can use wslconfig.exe to change the default distro. Saying "open bash here" is probably not a good idea as there are others who use other shells such as fish. Instead let it say "open WSL.exe here" or "open WSL here". Alternatively, Explorer can check wsl.exe to determine what the default distro is and say "open [default distro] here". This would probably be optimal. So if say Debian is my default distro, Explorer could say "open Debian here". If I change it via wslconfig.exe to Kali regardless of whether the Debian.exe is running or not, I should immediately be able to right click explorer and now see "open Kali here". It shouldn't take more than 5 seconds to perform the necessary check once you right click on Explorer and for usability really needs to be less than one. A process should be created that automatically terminates once the script is run.

  • Kevin O'Mara commented  ·   ·  Flag as inappropriate

    If you don't mind editing your registry, see: https://gist.github.com/kevin-d-omara/935deac93fd7a07cfa5d17ddf655d52e

    Simply copy the lines to a file with the ".reg" extension, then double-click it.

    Thanks to Jari Pennanen for posting the lines for right-clicking the background. I added support for right-clicking a folder.

    Pasted below for convenience:
    ---------------------------------------------------
    Windows Registry Editor Version 5.00

    ; * Adds Bash to the extended context menu (shift + right-click).
    ; * If you prefer the regular context menu (right-click),
    ; delete both lines containing <"Extended"="">.

    ; Context menu for right-clicking the background of a directory or the desktop.
    [HKEY_CLASSES_ROOT\Directory\Background\shell\Bash]
    @="Open Bash window here"
    "Extended"=""
    [HKEY_CLASSES_ROOT\Directory\Background\shell\Bash\command]
    @="bash"

    ; Context menu for right-clicking folders.
    [HKEY_CLASSES_ROOT\Directory\shell\Bash]
    @="Open Bash window here"
    "Extended"=""
    [HKEY_CLASSES_ROOT\Directory\shell\Bash\command]
    @="cmd.exe /s /k pushd \"%V\" && bash"

  • Cees Wesseling commented  ·   ·  Flag as inappropriate

    The workardound is to type bash.exe inside the top bar of Explorer where normally the path of your current folder is displayed like: > This PC > OS(C:) > <something>, if C:\<something> is the folder displayed

  • Felix Becker commented  ·   ·  Flag as inappropriate

    I would rather prefer an entry under the "File" menu of the explorer, next to "Run command prompt" and "Run Powershell"

  • Dave Lesage commented  ·   ·  Flag as inappropriate

    If you type `bash` in your file explorer address bar and hit enter, it will open a bash prompt to that location.

  • Jari Pennanen commented  ·   ·  Flag as inappropriate

    This works for right clicks in the explorer empty area:

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Bash]
    @="Open in Bash"

    [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\Bash\command]
    @="\"bash\""

  • Mike Smith commented  ·   ·  Flag as inappropriate

    I use conemu to do this. if you do use conemu, go to settings, then "Integration" => "ConEmu Here - Explorer context menu integration" => "Command:" = "bash.exe --login -i" => (Click Register)

Feedback and Knowledge Base