在OS X终端Bash提示符破 [英] Bash prompt in OS X terminal broken

查看:78
本文介绍了在OS X终端Bash提示符破的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用bash在OS X终端应用程序,我的自定义$ PS1休息时,我通过我的历史滚动。

I am using bash in os X Terminal app, and my custom $PS1 breaks when I scroll through my history.

PS1="${BLUE}\u${CYAN}@${RED}\h${BLUE}\w\n\[${red}\$${NC}\]"

也试过
    PS1 =$ {蓝} \\ U $ {}青色@ $ {RED} \\ H $ {}蓝色\\ W \\ r \\ n [$ {红} \\ {$$ NC}]

also tried PS1="${BLUE}\u${CYAN}@${RED}\h${BLUE}\w\r\n[${red}\$${NC}]"

这个问题似乎是在换行。我用Slackware的这个bash提示符没有概率。

The problem seems to be in the newline. I have used this bash prompt on Slackware no prob.

推荐答案

您需要[和] arond每一个转义序列;做$蓝等包含这些?如果不是这样,他们需要与这些电话进行包围曝光。

You need the [ and ] arond every escape sequence; do $BLUE and the like include these? If not, they need to be bracketed with these calls.

这篇关于在OS X终端Bash提示符破的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆