Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to reduce flickering #300

Merged
merged 1 commit into from
Dec 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions padd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -684,13 +684,8 @@ PrintLogo() {
}

PrintDashboard() {
# Clear the screen and move cursor to (0,0).
# This mimics the 'clear' command.
# https://vt100.net/docs/vt510-rm/ED.html
# https://vt100.net/docs/vt510-rm/CUP.html
# E3 extension `\e[3J` to clear the scrollback buffer (see 'man clear')

printf '\e[H\e[2J\e[3J'
# Move cursor to (0,0).
printf '\e[H'

# adds the y-offset
moveYOffset
Expand Down Expand Up @@ -932,8 +927,8 @@ SizeChecker(){
# this reduces "flickering" of GenerateSizeDependendOutput() items
# after a terminal re-size
sleep 0.1
console_height=$(stty size | awk '{ print $1 }')
console_width=$(stty size | awk '{ print $2 }')
console_width=$(tput cols)
console_height=$(tput lines)

# Mega
if [ "$console_width" -ge "80" ] && [ "$console_height" -ge "26" ]; then
Expand Down Expand Up @@ -1259,6 +1254,15 @@ TerminalResize(){
# kill the sleep function within NormalPADD() to trigger redrawing
# of the Dashboard
SizeChecker

# Clear the screen and move cursor to (0,0).
# This mimics the 'clear' command.
# https://vt100.net/docs/vt510-rm/ED.html
# https://vt100.net/docs/vt510-rm/CUP.html
# E3 extension `\e[3J` to clear the scrollback buffer (see 'man clear')

printf '\e[H\e[2J\e[3J'

kill $sleepPID > /dev/null 2>&1
}

Expand Down