Skip to content

Commit b0038a1

Browse files
A Dynamic Collection of Shell Scripts with Educational Purpose
1 parent 3d1ed70 commit b0038a1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/ble-simple

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,14 +605,14 @@ _cs_redraw() {
605605
fi
606606
# Calcula quantas linhas o conteúdo anterior pode ter ocupado
607607
local _term_cols; _term_cols=$(tput cols 2>/dev/null || printf '80')
608-
local _prev_len=$(( _CS_PS1_LEN + ${#_CS_BUFFER} ))
609-
local _prev_lines=$(( _prev_len / _term_cols ))
610-
# Sobe e limpa todas as linhas do wrap anterior
608+
local _total_len=$(( _CS_PS1_LEN + _CS_PREV_BUF_LEN ))
609+
local _prev_lines=$(( _total_len / _term_cols ))
611610
if (( _prev_lines > 0 )); then
612611
printf '\e[%dA' "$_prev_lines" >&2
613612
fi
614-
printf '\r\e[J%s%s' "$_CS_PS1_LAST" "$colored" >&2
613+
printf '\r\e[2K%s%s\e[K' "$_CS_PS1_LAST" "$colored" >&2
615614
printf '\r\e[%dG' "$(( ( _CS_PS1_LEN + _CS_POS ) % _term_cols + 1 ))" >&2
615+
_CS_PREV_BUF_LEN=${#_CS_BUFFER}
616616
_gt_overlay
617617
fi
618618

0 commit comments

Comments
 (0)