我在数字海洋液滴上运行Ubuntu 20。我用R和RStudio的闪亮服务器。
当我以用户身份使用终端登录时,提示符是自定义的,光标向上的错误会弹出前面的命令。这个很方便。
但是,当我以用户身份登录时,提示符是"$“。
/home/.bashrc/..bashrc的代码看起来像是自定义提示符。
为什么提示符不是自定义的,我如何使它被定制?
摘录自/家/发亮/..bashrc:
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt发布于 2022-05-07 02:08:02
.bashrc仅由Bash shell读取。如果您没有在用户创建时指定shell,那么它使用的是/bin/sh而不是/bin/bash。因此,为什么shell定制不运行。
从在chsh用户中运行shiny开始。请求路径时输入/bin/bash。它将要求用户密码,输入它。然后,这将更改用户的默认shell。退出用户并再次登录,它应该默认为使用Bash。
https://askubuntu.com/questions/1407104
复制相似问题