Tag Archives: terminal

zsh PS1 setup

macOS Catalina uses zsh as the new default shell (instead of bash) in Terminal. This means that many people will be looking to re-setup their CLI with ~/.zshrc instead of ~/.bash_profile.

While customizing my .zshrc was a hassle, it was also an opportunity to clean up my profile and remove legacy settings.

Zsh offers an optional right side prompt, but I only used the left side prompt for now.

Here are some misc tips that I’ve found helpful:

  • For basic PS1 exports (time/date, current dir, user, etc), you can find examples here. Things like %D for the current date, %~ for the current directoy, and more.
  • In your PS1 export, you can start color formatting with %F{117} and end color formatting with %f. Replace 117 with whatever color your desire. You can find color codes here.
  • You can make your tab auto completion case insensitive (ignore case) by adding:
    zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}'
    autoload -Uz compinit && compinit -i
  • You can show your current git branch with:
    autoload -Uz vcs_info
    precmd() { vcs_info }
    zstyle ':vcs_info:git:*' formats '(%b)'
    setopt prompt_subst

    Note: you also need to add $vcs_info_msg_0_ in your PS1 export line.

I’ve thought about creating a zshrc WYSIWYG tool, ala Halloween Bash, but I’ve shelved those plans since there’s only so much time in a day. With macOS Catalina inevitable for macOS users, more and more people are going to be looking for easy ~/.zshrc customization.

Staten Island September 11 Memorial

Went to Staten Island today. The free ferry is convenient from downtown.

Staten Island Ferry Terminal

They’ve gotten very efficient with loading/unloading the ferry (I think, but I don’t have to take this as part of my commute).

St George Terminal Architecture

The terminal architecture is very photogenic.

Staten Island September 11 Memorial

The Staten Island memorial is very tastefully done. It contains granite plaques with a silhouette to honor each victim.

Staten Island September 11 Memorial

The memorial faces ground zero.

Staten Island September 11 Memorial

The memorial is situated in a park next to the Staten Island terminal and baseball field lighting is visible in the background.

Staten Island September 11 Memorial

Each silhouette bears the person’s info and can hold memorial flowers.

Staten Island September 11 Memorial

From the memorial site, NJ & NY fill the skyline.