From c9e8a47af330230aeb69eb29571b010cf171fbea Mon Sep 17 00:00:00 2001 From: buffet Date: Fri, 15 Sep 2023 08:34:04 +0200 Subject: [PATCH] bash: print reverse video % when last line doesn't end in linebreak --- dots/.bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dots/.bashrc b/dots/.bashrc index f98e8fb..dbcafcc 100644 --- a/dots/.bashrc +++ b/dots/.bashrc @@ -10,8 +10,15 @@ bind '"\e\C-m": "\C-e | nvim\C-m"' __prompt() { local status="$?" + local row + local col - PS1='\[\e[0m\e[1m\][' + IFS=';' read -rs -dR -p $'\e[6n' row col >/dev/tty + if [[ $col != 1 ]]; then + printf '%s' $'\e[7m%\n\e[0m' + fi + + PS1='\[\e[0;1m\][' case $status in 0) PS1+='\[\e[36m\]' ;;