During my web development, I usually need to run different terminal applications, like webpack, node server, etc. As Windows command prompt does not support tabs, I had to open multiple command prompts, which is very ineffective. This is not a problem for Mac / Linux users, as their consoles support programs like tmux
.
Fortunately, now Windows 10 allows you to run a Linux subsystem inside windows. Once enabled, one can install a Linux distribution such as Ubuntu and can run Linux command line programs inside Windows (with some limitation though). With this, I can split my terminals into multiple parts as below.
Setting up Split screen terminals in Windows
Follow the steps to get this setup in Windows 10.
- Go to
Settings -> Update & Security -> For Developers
and enableDeveloper Mode
. Click Yes in the alert box. - Once you enable Developer Mode, now go to:
Control Panel -> Programs -> Turn Windows features on or off
. Search forWindows Subsystem for Linux
and enable it. This will install necessary components in your system. You may have to restart your system. - After you restart, go to
Microsoft Store
and search forUbuntu
. Install this app. - Once
Ubuntu
is installed in your system, open it (just search for it in start menu). When it opens for the first time, it will download necessary files and will ask you to create a username and a password. This does not need to match your Windows password. Remember this username and password as this will be theroot
user and needed to install anything inside Ubuntu. - Now you are inside Ubuntu land. You can run linux command line applications such as vi, git, apt-get, etc.
- Run
sudo apt-get install tmux
. This will install the terminal multiplexer application tmux. - Once
tmux
installed, now runtmux
.
Now you can run any tmux command. For example, to split the terminal screen vertically, press Ctrl + b
and %
. And to split screen horizontally, press Ctrl + b
and "
.
Bonus: Making your boring terminal to look awesome - ohmyzsh
The default bash terminal is good. But it is not that good without ohmyzsh - a framework to install themes and plugins in your terminal. Let's set this up.
- Inside Ubuntu terminal, run
sudo apt-get install zsh
. - Once
zsh
is installed, switch to it by runningzsh
. - Now go to http://ohmyz.sh/ and follow their instructions to install
ohmyzsh
. - Once it is installed, just close and reopen the Ubuntu. When
ohmyzsh
installed, it would have setupzsh
as your default terminal. - Open zsh profile by running
vi ~/.zshrc
and update any theme you want inZSH_THEME
options. You can see the list of themes in here: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
My favorite ohmyzsh
theme is ys. What's yours?