如何像往常一样在 Cmder ssh 上启用颜色和方案?
How can I enable color and scheme on Cmder ssh like it is usually?
我想知道当我有 ssh 连接时,是否可以在 Cmder 中更改主题或颜色?在 ssh 期间,一切几乎都是白色的。但通常 Windows Cmder 有自己的主题或颜色,如图片所示。
谢谢
SSH 连接:
Windows 上的命令:
我找到了如何给它上色的解决方案:
转到 ~/.bashrc 文件
用以下代码替换从 52 到 62 的行:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[3[01;32m\]\u@\h\[3[00m\]:\[3[01;34m\]\w\[3[00m\]$ '
else
PS1='${debian_chroot:+($debian_chroot)}\e[1;32m\u@\h:\e[1;36m\w\e[0m$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
这是结果:
要获得更多颜色选项,您需要安装 colortest:
sudo apt-get install colortest
然后查看颜色代码选项:
colortest-16b
要更改颜色,只需编辑第 55 行。
我想知道当我有 ssh 连接时,是否可以在 Cmder 中更改主题或颜色?在 ssh 期间,一切几乎都是白色的。但通常 Windows Cmder 有自己的主题或颜色,如图片所示。
谢谢
SSH 连接:
Windows 上的命令:
我找到了如何给它上色的解决方案:
转到 ~/.bashrc 文件
用以下代码替换从 52 到 62 的行:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[3[01;32m\]\u@\h\[3[00m\]:\[3[01;34m\]\w\[3[00m\]$ '
else
PS1='${debian_chroot:+($debian_chroot)}\e[1;32m\u@\h:\e[1;36m\w\e[0m$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
这是结果:
要获得更多颜色选项,您需要安装 colortest:
sudo apt-get install colortest
然后查看颜色代码选项:
colortest-16b
要更改颜色,只需编辑第 55 行。