zsh prompt and hostname

前端 未结 2 1651
执念已碎
执念已碎 2021-02-19 09:26

I use the following prompt in .zshrc:

PROMPT=\"%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%1~ %{$reset_color%}%# \"

When

2条回答
  •  时光取名叫无心
    2021-02-19 09:59

    If you're using OhMyZsh, this is one line to add at the bottom of you .zshrc if you want the user and hostname in your PS1/PROMPT :

    export PROMPT='%(!.%{%F{yellow}%}.)$USER@%{$fg[white]%}%M ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
    

    Enjoy ;)

提交回复
热议问题