A terminal emulator is a text-only application that emulates a console in a desktop environment. Basically, it is a GUI program that acts as a wrapper or front-end and allows you to run a shell and enter Command ⌘s that the operating system can interpret and execute.
And just as any other program or application, you can install, uninstall, and customize different terminals. There are many great terminals out there such as iTerm, Alacrity, Windows Terminal, Hyper.is, Kitty, guake, and gnome-terminal.
A shell is a command-line interpreter. It sits between the kernel (core) of an operating system and the user, and exposes the operating system’s services to a human user or other programs. In other words, a shell is a command-line user interface for accessing the services of the operating system. Some example of shells are: Power Shell, cmd, Bash, fish, and Zsh.
Windows terminal is a modern host application for Command-line tools and shells, like Command Prompt, PowerShell, zsh and bash (WSL). It’s very powerful and offers a lot of customization and productivity features like tabs, themes, customized color schemes, shortcuts, and much more.
Install Windows Subsystem for Linux (WSL): wsl ‐‐install or wsl ‐‐install -d Ubuntu
To make Windows Terminal able to render the fancy icons, install NERD-FONTS. Download a font, e.g., Droid Sans Mono Nerd Fonts; extract or unzip the archive, and install all the .otf Font files.
Install Zsh and Oh My Zsh in WSL:
sudo apt-get update && sudo apt-get upgrade
sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Do you want to change your default shell to zsh? [Y/n] Type Y to set zsh as the default shell.
Change Windows Terminal Settings to use Nerd-Fonts (“fontFace”: “DroidSansMono Nerd Font”). Click on Settings in the Windows Terminal menu, Open JSON file.
...
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": false,
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl",
"fontFace": "DroidSansMono Nerd Font"
}
Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Activate the theme by editing your ~/.zshrc file (~/.zshrc) and replacing ZSH_THEME=”robbyrussel” with ZSH_THEME=”powerlevel10k/powerlevel10k”. Restart the terminal and follow the Powerlevel10k configuration wizard.
zsh-autosuggestions, is a fish-like fast and unobtrusive autosuggestions for zsh, a real time saver! Installation with Oh-my-zsh: Clone its repository into ~/.oh-my-zsh/custom/plugins…
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
… and add the plugin to the list of plugins for Oh My Zsh to load, nvim ~/.zshrc: plugins=(zsh-autosuggestions).
zsh-syntax-highlighting. It provides syntax highlighting for the shell zsh. Installation: Clone its repository…
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
… and activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-syntax-highlighting)
Customize the color scheme and the hotkeys. Click on Settings in the Windows Terminal menu, Open JSON file.
{
"Command ⌘": { # Customizing the hotkeys
"action": "globalSummon"
},
"keys": "alt+t"
},
To open the Windows Terminal, press the Windows + X keys simultaneously on the keyboard. In the WinX menu, select the Windows Terminal option. Now, you will be able to bring up the Windows terminal by typing “Alt” + “t”.
{ "Command ⌘": "closeWindow", "keys": "alt+f4" }, # It closes the current window and all tabs within it
{ "Command ⌘": "toggleFullscreen", "keys": "alt+enter" }, # Toggle between full screen and default window size.
{ "Command ⌘": "toggleFullscreen", "keys": "f11" },
....
"schemes":
[
{ # Customizing the color scheme, Windows Terminal Themes, https://windowsterminalthemes.dev/
"name": "Dracula",
"black": "#000000",
"red": "#ff5555",
"green": "#50fa7b",
"yellow": "#f1fa8c",
"blue": "#bd93f9",
"purple": "#ff79c6",
"cyan": "#8be9fd",
"white": "#bbbbbb",
"brightBlack": "#555555",
"brightRed": "#ff5555",
"brightGreen": "#50fa7b",
"brightYellow": "#f1fa8c",
"brightBlue": "#bd93f9",
"brightPurple": "#ff79c6",
"brightCyan": "#8be9fd",
"brightWhite": "#ffffff",
"background": "#1e1f29",
"foreground": "#f8f8f2",
"selectionBackground": "#44475a",
"cursorColor": "#bbbbbb"
},
...
To resize the text, hold down the Ctrl key and scroll the mouse wheel or click the drop-down menu next to the New tab (+) button, select Settings, Defaults from the left pane, Appearance, Font Size. Then, change the font size as needed.
To change the default font face and the starting directory:
# Under the "profiles" section, inside the "default" brackets, type the following lines:
"startingDirectory": "%USERPROFILE%/Documents/",
"fontFace": "Consolas"
The Windows Terminal supports opening multiple tabs and splitting the terminal into multiple panes for better productivity and multitasking. To split the terminal into two panes, press Alt, Shift, and + (vertically), Alt, Shift, and - (horizontally). To switch between these panes, press Alt + arrow keys.
To open a hyperlink with your mouse, use Ctrl + click.
iTerm2 is a replacement for your macOS Terminal. It brings the terminal into the modern age. It's highly customizable and comes with a lot of useful features.
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
p10k configure # If you are using iTerm2, p10 configure can install the Meslo Nerd Font for you.
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
ZSH_THEME="powerlevel10k/powerlevel10k"
[...]
plugins=(git zsh-syntax-highlighting zsh-autosuggestions colored-man-pages colorize pip python brew)
[...]
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
… each of which is a separate session.
An iTerm2 Cheatsheet