From e7a3d742adf3f39958eae2013bcc4d8ccc2d31d3 Mon Sep 17 00:00:00 2001 From: xyz Date: Mon, 1 Nov 2021 01:40:45 -0700 Subject: .bashrc, PS1 tput also need \[ and \] around color code! --- home/xyz/.bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'home') diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 08239853..ef8ae9a0 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -26,8 +26,9 @@ esac #PS1='\[\033[0;91m\][\u@\h \W]\$ \[\033[0m\]' # tput is better for different terminals? +# but also need \[ and \] around color code! # setaf and sgr0 see `man terminfo` -PS1="$(tput setaf 1)[\u@\h \W]\$ $(tput sgr0)" +PS1="\[$(tput setaf 1)\][\u@\h \W]\$ \[$(tput sgr0)\]" # https://github.com/LukeSmithxyz/voidrice/blob/master/.config/shell/aliasrc for cmd in iotop nethogs hardcode-fixer ventoy; do -- cgit v1.2.3-70-g09d2