Ubuntu and the other Linux distributions available on Windows 10 use the Bash shell by default, but that’s not your only option. Windows has a compatibility layer for running Linux software on Windows, and you can use it to run Zsh or whatever shell you prefer.
The Zsh shell now works on Windows 10. You can have Bash automatically execute Zsh whenever you launch it. Oh My Zsh also works for customizing your Zsh shell in Windows, just as it does in Linux.
Start By Installing Bash
Before installing your shell of choice, you’ll first need to enable the Windows Subsystem for Linux and install a Linux environment. We’ll be using Ubuntu as an example in this article, but you can perform a similar process on openSUSE and other Linux distributions.
If you’ve already installed Bash on Windows, you’re good to go.
How to Install Zsh (or Another Shell)
After Bash is installed, you just need to install the shell you want to use from within Bash. You do this with the apt-get command, just as you’d install any other software package on Ubuntu Linux.
To install Zsh on Ubuntu, open the Bash shell and run the following command:
sudo apt-get install zsh
Press “y” when prompted, and then press Enter to continue. Apt-get automatically downloads and installs Zsh from Ubuntu’s repositories.
On other Linux distributions, just use your Linux distribution’s software installation command. For example, you’ll need to use the zypper command on openSUSE.
If you want to use another shell, specify the name of that shell instead of Zsh. For example, we’ve seen reports that the Fish shell also works well. To install it, you’d run the following command:
sudo apt-get install fish
How to Launch Zsh (or Another Shell)
To launch Zsh or another shell after it’s installed, just type the name of the shell in the Bash prompt, and then press Enter. For example, to start using Zsh from Bash, you’d just type:
You’ll be prompted to go through Zsh’s first-time setup process and create a configuration profile the first time you launch it. Type “2” to create a configuration profile with the recommended default settings.
To leave the zsh shell and return to Bash, just run the following command:
How to Directly Launch Zsh
You can launch the Zsh shell directly with a command like the following:
wsl zsh bash -c zsh ubuntu -c zsh opensuse-42 -c zsh sles-12 -c zsh
How to Make Bash Automatically Launch Zsh
You can also have Bash automatically switch to Zsh whenever you launch it.
To do this, you need to edit your .bashrc file. Bash runs the commands in this file every time it starts. You can make the edits using any text editor you like, including vi, but we’ll explain the process using nano.
To open the .bashrc file in nano, run the following command:
Add the following lines to the file. You could simply add the “exec zsh” line, but the following additional lines ensure that Bash only launches Zsh when you open a Bash window. This avoid causing problems for other software.
# Launch Zsh if [ -t 1 ]; then exec zsh fi
If you wanted to execute a different shell, you’d enter that shell’s command instead of the “zsh” command.
After you make the changes, press Ctrl+O and then Enter to save the file. Press Ctrl+X to exit nano afterwards.
Now, whenever you open the Ubuntu shortcut (or other Linux distribution shortcut) on Windows, it starts up with the Zsh shell.
To reverse your change, edit the .bashrc file again and delete the section you added.
All alternative Linux shells should work, in theory. If one doesn’t, Microsoft needs to fix the underlying Windows Subsystem for Linux so that is correctly runs more Linux software. You can view existing bugs and report new bugs to Microsoft at the BashOnWindows GitHub page.
- › How to Install and Use the Linux Bash Shell on Windows 10
- › Everything You Can Do With Windows 10’s New Bash Shell
- › What is ZSH, and Why Should You Use It Instead of Bash?
- › The 10 Best Netflix Original Movies in 2022
- › NZXT Signal 4K30 Capture Card Review: Lossless High-Quality Footage
- › What’s New in Windows 11’s 22H2 Update: Top 10 New Features
- › A World Without Wires: 25 Years of Wi-Fi
- › T-Mobile Is Selling Your App Activity: Here’s How to Opt Out