Stuff About Apple

How to Change the Window Title in Terminal (zsh + oh my zsh)

Andrew Zheng
2 min readFeb 12, 2020
A window title that you can customize.

So in MacOS Catalina, the terminal kept screaming at me to update to zsh. That’s what I did. But then, my personal name and some other personal information became the title of the window.

I’ve recently started writing on Medium and I don’t want to accidentally screenshot my personal stuff. So, the first step I had to take was change the terminal window title.

With bash, you could simply just open Terminal Preferences and set the window title. But with zsh, paired with oh my zsh, the window title becomes your username and the current directory…

Here is how you change the terminal window title.

  1. Type open ~/.zshrc. Then hit enter. (Or vim ~/.zshrc, if you prefer vim)

*Update* If you’re getting a “File does not exist” error, you may first have to create .zshrc manually like this:

touch ~/.zshrc

2. TextEdit (or vim) should open. Now, search for DISABLE_AUTO_TITLE=”true”

This is what your mac should look like.

3. Now, delete the # in front of the DISABLE_AUTO_TITLE=”true”. Then press Command + S to save. You can close TextEdit now.

4. Go back to terminal, and type source ~/.zshrc.

5. Now, open terminal preferences by pressing Command + ,. Then, head over to “Profiles” and then “Window” (Shown below).

6. Now, type whatever name you want for the terminal title! Also, uncheck:

  • Working directory or document
  • Active process name
  • Shell command name
  • Profile name
  • TTY name
  • Dimensions
  • Command key

7. Now, close terminal by pressing Command + W. Then, open terminal again, and your title should be whatever you set it to be!

--

--

Andrew Zheng

WWDC21 Scholar. I like to read manga and write about Swift. Check out my app, Find — look for text in real life, with outrageous speed. getfind.app