How to Customize Zsh Command Prompt Text

Coding With Adam
Coding With Adam
35 هزار بار بازدید - 2 سال پیش - In this video you will
In this video you will learn how to customize the Z Shell(Zsh) command prompt text.  

We will understand how the text is formatted using special characters. We will add color to the command prompt. This will include colors using words and 3 digit codes. We will explore what PS1 and Prompt environment variables are. Additionally we will add prompt text to the right side of the screen using RPrompt  Lastly we will hide the "last login text" when you open a new command prompt using a special file called .hushlogin

All the changes we do here will be reflected for VSCode if zsh is your default command prompt in VSCode.

Indirectly from this fun tutorial you will learn the following commands / concepts
- cd - change directory
- ls - list directories
- touch - make a file if does not exist
- rm - remove file
- pwd - current location
- environment variables
- reload zshrc file

This is the default command prompt format::
PS1="%n@%m %1~ %# "

This is the default command prompt format:
PS1="%n@%m %1~ %# "

The final Prompt and RPrompt values:
PROMPT="%F{magenta}Adam%f %U%F{yellow}%1~%f%u %F{blue}$%f "
RPROMPT="%F{241}%T%f"

Color list
https://www.tweaking4all.com/software...

https://github.com/CodingWith-Adam/zs...

00:00:00 Intro
00:00:45 Set theme
00:01:19 Prompt Text
00:01:42 Where does the prompt text come from
00:02:55 Prompt text structure
00:04:00 Change prompt text
00:07:30 Color and formatting
00:09:48 Right prompt text
00:12:02 Hide last login
2 سال پیش در تاریخ 1401/03/07 منتشر شده است.
35,046 بـار بازدید شده
... بیشتر