Colored terminal for windows linux subsystem

Colored terminal for windows linux subsystem

I share my terminal configuration that I use every day for my laptop. I always like to have ergonomic and colored informations with a command line interface. I was not satisfied with default linux tools (for this purpose) and customizable shell such as ZSH (regarding performances on Windows + proxy mainly).

Select a command line interface

Customized prompt

First I choose my command line interface. I realy like Hyper it’s very beautifull software,highly configurable in a simple json file, have plugins support and multiplatform.

The only thing that is missing on this interface is clearly a better startup tab management, especially on windows to start multiple tabs with Ubuntu subsystem, cmd, powershell in one clic.

Select a picto friendly font for your console output

Nerd Fonts is a project that patches developer targeted fonts with a high number of glyphs (icons). Specifically to add a high number of extra glyphs from popular ‘iconic fonts’

For my terminal, I choose DejaVuSansMono NF

- I simply installed it on windows with a right clic and "install".
- Then I update hyper to take this font as the default one.


    fontFamily: '"DejaVuSansMono NF", monospace',

Configure prompt with git and picto in .bashrc

Next step was to improve prompt with clear and visual informations thanks to nerd font. A little bit of dirty scripting is needed here (perhaps this part could be improved for performances) to be able to retrieve git informations to prompt when you are on a repo folder.

# get current status of git repo
function parse_git_branch() {
        BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
        if [ ! "${BRANCH}" == "" ]
                echo " [${BRANCH}${STAT}]"
                echo ""

function parse_git_dirty {
	status=`git status 2>&1 | tee`
	dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"`
	untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"`
	ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"`
	newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"`
	renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"`
	deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"`
	if [ "${renamed}" == "0" ]; then
	if [ "${ahead}" == "0" ]; then
	if [ "${newfile}" == "0" ]; then
	if [ "${untracked}" == "0" ]; then
	if [ "${deleted}" == "0" ]; then
	if [ "${dirty}" == "0" ]; then
	if [ ! "${bits}" == "" ]; then
		echo " ${bits}"
		echo ""

# Configure my prompt output using DejaVuSansMono NF font that include pictos I want 
export PS1=" \u\[\e[m\]\[\e[32m\]\W\[\e[m\]\[\e[33m\]\`parse_git_branch\`\[\e[m\]  "

and here is the result !

Customized prompt

You can check :

  • your user logged name
  • the name of your current repo
  • A visual branch status of your git repo.

Colored utilities

Next step is to have improvement regarding utilities that your are using every day. Here is some of them.


Colorizes the ls output with color and icons.

Customized prompt


bat supports syntax highlighting for a large number of programming and markup languages.

Customized prompt


It’s an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.

Customized prompt

if you want to upgrate your ctrl+r interface for command line history search

add to your .bashrc

[ -f ~/.fzf.bash ] && source ~/.fzf.bash


fd is a simple, fast and user-friendly alternative to find.


A collection of simplified and community-driven man pages

Customized prompt


diff-so-fancy strives to make your diffs human readable instead of machine readable. This helps improve code quality and helps you spot defects faster.

NB: Remember to add git-so-fancy to ther path vartiable on .bashrc file

export PATH=$PATH:/home/ibrahim/.prettyping:/home/ibrahim/.diff-so-fancy


prettyping is a wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.

Customized prompt


This is htop, an interactive process viewer for Unix systems. It is a text-mode application (for console or X terminals) and requires ncurses.

Customized prompt


w3m is a text-based web browser as well as a pager like more' or less’.


HTTPie—aitch-tee-tee-pie—is a command line HTTP client with an intuitive UI, JSON support, syntax highlighting, wget-like downloads, plugins, and more.

Customized prompt

Make some usefull aliases


alias ping='prettyping'
alias ls='lsd -la'
alias cat='bat'
alias preview="fzf --preview 'bat --color \"always\" {}'"
alias top="sudo htop"
alias find="fd"
alias man="tldr"
alias diff="diff-so-fancy"
alias browser="w3m"
alias wget="http -df"

alias powershell="/mnt/c/Program\ Files/PowerShell/7-preview/pwsh.exe -WorkingDirectory C:/Users/<USER>"
alias winps="tasklist.exe /svc"
alias winkillall="taskkill.exe /F /IM"
alias vscode="/mnt/c/Users/<USER>/AppData/Local/Programs/Microsoft\ VS\ Code/Code.exe"

That’s all for today !