修改 zshrc推荐修改方式vim ~/.zshrc# 重写 prompt_contextprompt_context () {}# 也可以使用自定义提示符prompt_context () { prompt_segment black default “hoo”;}修改主题不推荐直接修改主题,更新或者更换主题需要重新修改以 agnoster 为例,可以注释 prompt_context 或者也可以修改内容。注释中也有提示,不需要显示的可以隐藏,不会影响别的组件的展示vim ~/.oh-my-zsh/themes/agnoster.zsh-theme# Each component will draw itself, and hide itself if no information needs to be shown# Context: user@hostname (who am I and where am I)prompt_context() { if [[ “$USER” != “$DEFAULT_USER” || -n “$SSH_CLIENT” ]]; then prompt_segment black default “%(!.%{%F{yellow}%}.)%n@%m” fi}## Main promptbuild_prompt() { RETVAL=$? prompt_status prompt_virtualenv prompt_context prompt_dir prompt_git prompt_bzr prompt_hg prompt_end}