---
title: "Discussion on \"A Guide to Customizing the Zsh Shell Prompt\" | Hashnode"
description: "Discussion on \"A Guide to Customizing the Zsh Shell Prompt\". The goal of this article is to teach you just enough about the shell prompt to make some helpful customizations. \nWhat is the shell prompt?\nThe prompt is the bit of text that shows up in our shells to indicate that we can interact with them. The prom..."
url: "https://hashnode.com/posts/a-guide-to-customizing-the-zsh-shell-prompt/604a8704ad1cac7d577dfa5e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [A Guide to Customizing the Zsh Shell Prompt](https://voracious.hashnode.dev/a-guide-to-customizing-the-zsh-shell-prompt?utm_source=hashnode&utm_medium=feed)

The goal of this article is to teach you just enough about the shell prompt to make some helpful customizations. What is the shell prompt? The prompt is the bit of text that shows up in our shells to indicate that we can interact with them. The prom...

Mar 11, 2021 · 6 min read · voracious.hashnode.dev  
Updated May 26, 2022  
Read the article

-   [#bash](https://hashnode.com/tag/bash)
-   [#zsh](https://hashnode.com/tag/zsh)
-   [#tutorial](https://hashnode.com/tag/tutorial)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[David R. Myers](https://hashnode.com/@voracious)

@voracious · Columbus, Ohio, United States

  
[View profile](https://hashnode.com/@voracious)

Senior Software Engineer

Senior Software Engineer sharing resources, tips, and lessons learned | Building octo.app in public | Black Lives Matter

## Responses 2

Markdown supported · ⌘↵ to post

[Matthew Lowe](https://hashnode.com/@lowey)

[Dec 6, 2021](https://hashnode.com/posts/a-guide-to-customizing-the-zsh-shell-prompt/604a8704ad1cac7d577dfa5e/comment/61adedbe9dc5a836391ba942)

Very useful, thanks. I just bought a new mac and it defaults to zsh, so figured I might as well as make the leap from Bash to Zsh.

Only comment I'd make is you need to include:

`setopt prompt_subst`

else the `$vcs_info_msg_0_` won't get expanded in the prompt. With your help and a little more searching I ended up with:

```
autoload -Uz vcs_info
setopt prompt_subst
precmd () { vcs_info }
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '%F{red}*%f'
zstyle ':vcs_info:*' stagedstr '%F{green}*%f'
zstyle ':vcs_info:*' formats ' (%F{blue}%b%u%c%f)'
PS1='[ %B%n%b@%B%m%b:%F{green}%/%f$vcs_info_msg_0_ ] $ '
```

[David R. Myers](https://hashnode.com/@voracious)

[Mar 12, 2021](https://hashnode.com/posts/a-guide-to-customizing-the-zsh-shell-prompt/604a8704ad1cac7d577dfa5e/comment/604ad65fad1cac7d577dfd35)

If you found this article useful or you found it lacking, please let me know! I'd love to improve my writing and improve this resource for you all. I'm just a quick comment away. 😁
