A Guide to Aesthetically Pleasing Terminal
Many of us are busy to figure out how to customize work environment and I have to admit it is a tedious work to do. You need to google how to customize your favorite IDE, how to change fonts, text colors in terminal, experiment with couple of work palette and style and on and on.
But you gotta admit, default terminal screens are a bit boring. Using the same black & white screen as everybody does is not my thing. So I customized mine and going to help you to do the same. Let’s customize your shell windows both on MacOS and Windows.
For Windows
Windows command prompt(cmd) actually never grew on me. I learned shell scripting on Mac and Linux(Raspberry Pi) so cmd always reminded of me the times when I got my first computer in 90’s. It was a painful experience -maybe even a childhood trauma- because somehow my Windows 95 crashed and I got stuck with a cmd on black screen, getting into directories and opening games, ms office and all the other stuff while my other geek mates having a lovely time with their UI. There were no internet back at that time, I can’t call my uncle(he bought me that computer) for every command I have to type; so I asked my mom to buy me a book for this. There was only one place for this sort of things in Istanbul; a big market for books, cassettes, vinyls etc. called Akmar. This place was also a hub for metalheads and all other interesting folks since they can buy their cassettes, comic books etc. only from there. I had to convince my mom I am not a satanist or some kind of weirdo which I couldn’t. luckily, I got my first macbook more than 10 years ago and started using terminal whenever I had to.
Okay, since the story time is over we gonna have to find a way to start a regular bash on Windows. The simplest way is installing git which I assume most of you has already installed it. For those coming onboard late, git is a version control system to back-trace your code. But we merely use it’s shell screen as a substitute for windows command prompt. If you haven’t installed it yet go to the git offical website https://git-scm.com/ and install.
Now you can run Git Bash by right-clicking on any folder(even on your desktop) and selecting the Git Bash Here option from the context menu(right-click menu).
When we opened up git bash:
By right-clicking upper left corner of your git bash window, head to the Options, customize anything you want. You can even select a theme like me. Then click apply, voila you have your customized, nice looking terminal. You are now the cool kid on the block.
MacOS
I do most of my daily tasks on Mac so this part would a bit more detailed than the windows part. We don’t have to install but we have to edit a lot. Let’s start with .bash_profile. What is it? Well when you login into a UNIX system, it starts a program for you(shell) and it first call .bash_profile which is basically used for storing environment variables, starting scripts etc. We are going to use it to store our customized preferences.
To edit this file you can go to your home directory and open it with your favorite text editor. But since you are here to customize your terminal, let’s do it with terminal, shall we?
nano ~/.bash_profile
What it does is basically open this file with a text editor called Nano. We could have used vim too but let’s not worry about that.
Add these lines to the file:
export PS1=”\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ “
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls=’ls -GFh’
PS1
is a primary prompt variable which holds \u@\h \W\\$
special bash characters. This is the default structure of the bash prompt and is displayed every time a user logs in using a terminal.
So what are those other things? ls
shows colors if the CLICOLOR
environment variable is set or if -G
is passed on the command line. The actual colors are configured through the LSCOLORS
environment variable (built-in defaults are used if this variable is not set).
And from upper left corner, click terminal>preferences edit the color as you like.Here how’s mine look like:
If you like pastel colors too, you can use this post from reddit to pick ANSI colors.
Also when you look closely, I also changed the background image and the opacity from colors & effects. Now I have this:
Better than default terminal profiles, right?
In the next post, I am going to customize my favorite text editor in the same manner.