Ability to change Windows SSH Client

Is it possible to change the default SSH client on Windows? (Hoping to use Git Bash.)

I have found conflicting answers to this. My Preferences > Advanced screen shows only “Faster Docker Volumnes”

Hey Mark,

Right now that option is only available on Local for macOS. I’ve made a note to add that option to the Windows version.

Sorry for any confusion!

1 Like

Is this option going to be available for Windows any time soon? I would prefer to use cmder or even gitbash.

@danemorgn,

Thanks for the feedback!

I’ve moved this up in the backlog so it should come sooner than later :slight_smile:

Vote up for this feature.
Git Bash or PowerShell are good alternatives.
Win 10 itself is trying to ditch old command line.

2 Likes

This would be great, I’d like also to be able to use Powershell.

1 Like

Found that in VSCode they have similar feature for choosing integrated terminal, exactly what we want for Local

+1, the default cmd is not very good, there are much better alternative for Windows…

I’ve got a simple workaround. Here’s what I did:

  1. Run SSH once via the menu, then look for the .bat file in C:\Users\YOUR USER NAME\Roaming\Local by Flywheel\ssh-entry. Note: I couldn’t find the ssh-entry folder until I ran SSH once first via the menu.

  1. Make another .bat file somewhere in your PATH that runs this .bat file. I called mine wp-test.bat

  1. Run the new .bat file in your terminal app of choice (Hyper, ConEmu, the new Windows Terminal, etc). Here’s a screenshot of Hyper running PowerShell where I run the bat to SSH into my Local instance and run a few commands:

Note: there is perhaps some confusion over the difference between shells, terminals and the Windows Console in this thread (understandable - it’s a confusing topic). There’s a brief clarification in this post from the new Windows Terminal team.

Hope that helps. :slight_smile:

Charles

2 Likes

VERY! Thanks Charles.

For those who want to have this work through Git Bash command prompt on Windows your command to execute it would be:

winpty ./newbatch.bat

I followed the steps outlined by @charlesroper (thank you for sharing this!) but it didn’t actually let me use a different SSH client. I ran the .bat file in Git Bash, it says “loaded shell” but then it just exits and dumps me right back into my computer’s environment instead of letting me run any commands on my Local site.

I love Local so far, but I can’t use it if I can’t SSH to the Local site, and Windows’ terminal is totally useless.

Just to echo what @wpalchemy said (:wave:), this has gone from an annoyance with the old Local to the #1 reason I’m mostly not using Local “Lightning” despite the noticeable speed increases. Because of the way the local environment works in Lightning, I don’t even have access to *nix commands like ls! This may be a bigger issue, but all the wp-cli database commands also don’t work, apparently because grep isn’t supported in Windows terminal (or at least that’s the first error that I get).

If Local is actually going to support Windows, this needs a real solution ASAP.

1 Like

I kind of got this working! It’s still a hassle, and Local still needs to bake in the ability to change the SSH client. Here’s what I did:

  • Install the Windows subsystem for Linux: https://docs.microsoft.com/en-us/windows/wsl/install-win10
  • Create a local site
  • Find the .bat file in C:\Users<username>\AppData\Roaming\Local\ssh-entry
  • Create a new .bat file in your root directory (C:\Users<username>) as @charlesroper described
  • Open a new Windows command prompt (type Windows key, then “cmd”)
  • Run the new .bat file (just type in the name)
  • It will start up the local command line, and then you can type “wsl” to get the Windows subsystem

I think you have to go through this process every time you stop/start your site.

Of course, using the Windows subsystem for Linux opens up a whole other complicated can of worms…

Thanks for that. But I tried running that command from Git Bash, and it returns this error:

Error checking TLS connection: Host is not running

Thoughts on that?

I’ve had some half luck with @wpalchemy’s solution!

Some notes:

  • While the script seems to run in Git Bash (using winpty ./the-bat-file.bat) it doesn’t actually result in me ssh-ing into the site. It says the environment is loaded, but I’m still in the same folder and wp commands aren’t recognized.
  • Running this in the command line does work. I’m taken to my local site’s install and all wp commands still work. However, in this situation, I’m still stuck with windows commands (dir instead of ls, etc.)
  • When I run wsl from that fold, it does launch WSL but I can no longer use wp-cli: “/mnt/c/Program Files (x86)/Local/resources/extraResources/bin/wp-cli/bin/wp: line 1: …/wp-cli.phar: No such file or directory”
  • Even after all of this, I still can’t get wp db export working via command line. I get this:

‘grep’ is not recognized as an internal or external command,
operable program or batch file.
mysqldump: Got error: 2003: Can’t connect to MySQL server on ‘localhost’ (10061) when trying to connect

1 Like

Is this option still not available on Windows? I can’t do any command line based commands with Command Prompt which is opening by default.

@wpalchemy @JordanC26 @cagross @charlesroper @Lucas @web2033 @nathanbase @danemorgn Local started a new Feature Request site and archived this one, so you can upvote this feature here if you’re still interested: https://localwp.canny.io/feature-requests/p/change-default-shellterminal-on-windows

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.