How to set an emoji as Zsh terminal prompt in macOS

Custom Zsh Prompt macOS
Custom Zsh Prompt macOS

It would be so much fun to update the Zsh Shell default prompt from a % sign to something that you like, say an unicode emoji? Well this is possible, all you need to do is set the PROMPT variable in .zshrc file.

By default the .zshrc profile file is not available on macOS, you need to create it, try the below command, it will create the file for you if does not exists.

% nano ~/.zshrc

This will open up the file in nano editor, just add the below lines at the start of the file,

 🦋 '
Adding custom Prompt to zshrc file
Adding custom Prompt to zshrc file

Now press Ctrl + X to exit and Y to save, and press Enter. Now to reflect these updates, you run the below command,

% source ~/.zshrc

Thats it! You should see the butterfly emoji now as the new Zsh prompt.

Try Out Code2care Dev Tools:


Android Java Linux Microsoft Google Python macOS Notepad++ Microsoft Teams CSS PHP SharePoint Html Linux C Programs Bootstrap jQuery Sublime Android Studio Facebook Eclipse WhatsApp News MySQL Json HowTos JavaScript FTP S3


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Tutorials, Trouble-Shooting steps, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.
🎉 We are celebrating the 10th years of Code2care! Thank you for all your support! We hope we made a difference.
We strong support Gender Equality & Diversity.

We stand in solidarity with Ukraine - Make a donation to UNHCR -