@
jr028740 你按照 @
tatsuteng 的命令,实际上 bash 会有一个 bashrc
$ cat /etc/bashrc
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"
按照我的,你输出空行因为 /etc/zshrc 的默认并没有设定$PS1 ,在我的机器上是
$ cat /etc/zshrc
# Correctly display UTF-8 with combining characters.
if [ "$TERM_PROGRAM" = "Apple_Terminal" ]; then
setopt combiningchars
fi
disable log
我自己是 source 了我自定义的~/.zshrc ,所以能拿到我的$PS1