Setup Terminal for Windows
I recently moved to a Windows environment, Windows 10 to be exact, and trying to set up a Unix terminal. Since Windows is not Unix based, things can be a bit difficult...
There's a simpler way to use Unix commands on Windows, called Git Bash
, but I wanted to have a pretty terminal with themes using oh my zsh
(...and to torture myself)
There are many articles online for how to set up zsh
on Windows, I am listing the steps below that worked for me...
Install Windows Subsystem for Linux
Control Panel
=>Programs
=>Turn windows features on and off
- Check the checkbox for
Windows Subsystem for Linux
- Wait for install to finish and restart computer
Install Linux
- Go to
Microsoft Store
- Search for
Linux
There are many flavors of Linux to choose from, I'm usingUbuntu 18.04LTS
(LTS
stands forLong Term Support
)
Install Hyper terminal
Install Powerline Font for Windows
- Go to Powerline Fronts Github Page
- Download the repo as
ZIP
- Extract the zip file
- Run
Powershell
asAdministrator
and navigate to the extracted fonts folder -
To install all the fonts using the provided script, run the following command
as Administrator
usingPowershell
:powershell -ExecutionPolicy Bypass .\install.ps1
This command temporarily set the
ExecutionPolicy
in order to execute a foreign script, you can double check yourExecutionPolicy
remains unchanged by usingGet-ExecutionPolicy
, default isRestricted
Configure Linux
- Launch your installed Linux. (If it's the first time, you will need to set a username and password)
- Install
ZSH
by usingsudo apt-get install zsh
- Open your bash profile,
nano ~/.bashrc
- Add
bash -c zsh
to the top of the file. ctrl + o
to save the file,ctrl + x
to exit nano- Install
Oh My Zsh
usingsh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Default theme of
Oh My Zsh
isrobbyrussel
, but another popular one isagnoster
. You can change it by editing the~/.zshrc
file.
Configure Hyper
- Launch
Hyper
- Open
Preferences
(ctrl + ,
orRight click
on the terminal window and selectPreferences
) -
Look for
plugins
and edit:plugins: [ "verminal", "hyperpower", "hyper-search", ]
verminal
is a terminal theme for hyper,hyperpower
gives your terminal a little pop, andhyper-search
give you a search window on the Terminal (ctrl + shift + f
in Windows), you can search for them to see what they do -
Look for
fontSize
and put the following above it:verminal: { fontSize: 14, fontFamily: "Source Code Pro for Powerline" }
Remember the
Powerline
fonts we installed earlier? You can choose any of them -
Look for
shell
and edit the following:shell: 'C:\\Windows\\System32\\bash.exe',
-
Look for
shellArgs
and edit the following:shellArgs: ['--login', '-c', 'zsh'],
- Restart
Hyper
, and if everything is configured correctly, enjoy your shiny new terminal! 🎉🎉🎉
One issue I find while using Windows Subsystem for Linux is the configuration difference for developing NodeJS, I have a seperate article talking about that
Thanks for reading!