Set Up Windows Terminal for Conda Bash

When I'm using Windows I often find that I need to use different shells: PowerShell, bash with Conda set up, sometimes even cmd. I've found that Windows Terminal is convenient for this, but found the setup to be a bit tricky to get right. One big factor is that I also want these shells to have the Visual Studio environment correctly initialized, which has to happen in cmd because Windows is ridiculous. Here are the magic commands:

Visual Studio, Conda, and Powershell🔗

cmd.exe /K "call vcvars.bat && C:\Users\peter\miniforge3\Scripts\activate.bat && powershell"

Visual Studio, Conda, and Bash🔗

cmd.exe /K "call vcvars.bat && C:\Users\peter\miniforge3\Scripts\activate.bat && bash"

Note that on Windows, the git Conda package provides bash! The MSys2 package of Git is old and out-of-date. So you should install git but neither m2-git nor m2-bash.

Questions or comments? For better or worse this website isn’t interactive, so send me an email or, uh, Toot me.

To get notified of new posts, try subscribing to my lightweight newsletter or my RSS/Atom feed. No thirsty influencering — you get alerts about what I’m writing; I get warm fuzzies from knowing that someone’s reading!

See a list of all how-to guides.

On GitHub you can propose a revision to this guide or view its revision history.