Javarevisited

A humble place to learn Java and Programming better.

Follow publication

Better MacOS Terminal for Programmers: Use zsh without installing iTerm2

Nipuna Upeksha
Javarevisited
Published in
3 min readFeb 2, 2024

👋 Introduction

Terminal application is one of the most important, if not, the most important application in MacOS. Although MacOS has several built-in shells, most of the time users use either zsh or bash shells. To check which terminal you are using on Mac, simply open your terminal and type,

echo $SHELL

In this article, we will be looking at how you can configure MacOS’s built-in zsh terminal. To check whether the zsh terminal is on your Mac, type the following command.

cat /etc/shells | grep "zsh"

If you have confirmed that you have zsh shell installed in your Mac you are all set for spicing up the Mac terminal. But if you are not, you have to install zsh terminal. You can install it with brew install zsh But for that, you need to have Homebrew installed on your machine. Homebrew is a package manager tool for MacOS and we need that to make changes to our zsh shell as well.

🍺 Installing Homebrew

To install Homebrew you can simply follow the below given instructions.

  • Run /bin/bash -c "$(curl -fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" to install Homebrew.
  • After the installation, it will provide two commands to run in the terminal as on-screen instructions.
  • 1st command → echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/<username>/.zprofile
  • 2nd command → eval "$(/opt/homebrew/bin/brew shellenv)"
  • Type brew in your terminal to confirm you have installed Homebrew correctly.

💻 Install zsh

If you did not have zsh terminal when you ran cat /etc/shells | grep "zsh" , you can install zsh with Homebrew by typing brew install zsh After the installation confirm you have zsh terminal by typing cat /etc/shells | grep "zsh" one more time.

After that, change the default terminal to zsh terminal by typing the below command.

chsh -s /bin/zsh

Restart your terminal to check whether the changes are applied correctly.

🎨 oh-my-zsh

Now let’s make our terminal colorful 🎨 To do that follow the below given instructions.

🤔 auto-suggestions

In addition to making your terminal beautiful, you can also use auto-suggestions with your zsh terminal as well. To use the auto-suggestion capability, simply follow the below-given instructions.

  • Clone git repository and install → git clonehttps://github.com/zsh-users/zsh-autosuggestions${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  • Update .zshrc file → plugins=(zsh-autosuggestions) (If you already have git in the plugins section, plugins=(git zsh-autosuggestions)
  • Source .zshrc file → source ~/.zshrc

There you go! Now you have a beautiful and better terminal to work with your projects from now on! 😊

📚References

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Javarevisited
Javarevisited

Published in Javarevisited

A humble place to learn Java and Programming better.

Nipuna Upeksha
Nipuna Upeksha

Written by Nipuna Upeksha

Software Engineer | AWS SAA | AWS DVA | IAM Expert | MSc. in Big Data Analytics

No responses yet

Write a response

What I applaud in Mr. Carnevale's piece is an attempt to shift the attention away from affirmative action and college (now, there's a silo) to education reform of K-12 education. In my view, the problem starts when humans by and large support their…

Affirmative Action still around?

interesting