commit 9df41c1e4fce93702d98fd0c39fa055421cf4ded parent 0541977ad3847bc52ae8cd32cc0ac0a4f7bc5675 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Wed, 2 Oct 2019 07:39:21 +0200 Use tput for terminal prompt escape codes Diffstat:
M | .kshrc | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.kshrc b/.kshrc @@ -3,7 +3,11 @@ HISTSIZE=50000 set -o vi -PS1="\\033[32m\u@\h \\033[34m\w \\033[0m\$ " +if [ $(tput colors) -gt 8 ]; then + PS1="$(tput setaf 2 2 2)\u@\h $(tput setaf 4 4 4)\w$(tput sgr0) \$ " +else + PS1="\u@\h \w \$ " +fi export PS1 [ -f $HOME/.config/sh/profile ] && . $HOME/.config/sh/profile