bash: print reverse video % when last line doesn't end in linebreak
This commit is contained in:
parent
5d99efa152
commit
c9e8a47af3
1 changed files with 8 additions and 1 deletions
|
@ -10,8 +10,15 @@ bind '"\e\C-m": "\C-e | nvim\C-m"'
|
||||||
|
|
||||||
__prompt() {
|
__prompt() {
|
||||||
local status="$?"
|
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
|
case $status in
|
||||||
0) PS1+='\[\e[36m\]' ;;
|
0) PS1+='\[\e[36m\]' ;;
|
||||||
|
|
Loading…
Reference in a new issue