Ser*_*nev 2 linux bash shell command-prompt ps1
我有下一行.bashrc:
PS1="\e[0;32m[ \w ]\n#\e[m "
Run Code Online (Sandbox Code Playgroud)
设置非常简单的绿色欢迎线.在Ubuntu上使用向上/向下箭头加载以前的命令会在命令行中添加额外的符号:
[ /tmp ]
# echo "hello there"
hello there
[ /tmp ]
# echecho "hello there"
Run Code Online (Sandbox Code Playgroud)
注意ech最后一个命令前面的符号.这些符号无法编辑 - 光标不会到那里.
我做错了什么?
Lev*_*sky 10
您需要转义未显示的字符.将行更改.bashrc为以下内容:
PS1="\[\e[0;32m\][ \w ]\n#\[\e[m\] "
Run Code Online (Sandbox Code Playgroud)
运行source ~/.bashrc以应用更改.
| 归档时间: |
|
| 查看次数: |
1790 次 |
| 最近记录: |