我已经尝试过名为的现有库,powerline
但对于我老化的笔记本电脑来说似乎很重。我已经设法获得背景颜色,但不知道获得形状。目前我所拥有的是:
。
有没有直接的方法来获得这些形状?
我在用:
$ echo $TERM
xterm-256color
$ echo $SHELL
/bin/bash
$ bash --version
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
You need to have powerline patched fonts installed. Get them here
And you need to configure your terminal to use them. (this ofc depends on your terminal but probably something like settings -> appearance -> fonts)
I've done something similar if you want a startingpoint: sbp
You can try it out by running . prompt.bash
.
Basically all you need if the fonts are installed and enabled is this $'\uE0B0'
somewhere in your PS1. It's the utf8 code for the fancy triangle. Assuming you're on a recent version of bash with some utf8 as locale, that should do it. Try echo -e $'\uE0B0'
in your terminal to test it.