Bash prompt line wrapping issue

前端 未结 2 402
时光取名叫无心
时光取名叫无心 2021-01-11 18:50

Newbie question, I recently changed my PS1 into this:

RESET=\"\\[\\017\\]\"
NORMAL=\"\\[\\033[0m\\]\"
YELLOW=\"\\[\\033[0;33m\\]\"
CYAN=\"\\[\\033[0;36m\\]\"         


        
2条回答
  •  梦谈多话
    2021-01-11 19:43

    I think you're double-quoting your escape codes with [ and ]. Try this one:

    export PS1="$RESET\u@\h:$CYAN\w$YELLOW\$(__git_ps1)$NORMAL \$ "
    

提交回复
热议问题