vtebench 0.3.1

Terminal emulators benchmark
#!/bin/sh

# Update the entire grid as often as possible with a huge payload in every cell.

columns=$(tput cols)
lines=$(tput lines)

line_steps=1
if [ $lines -lt 155 ]; then
    line_steps=$((155 / lines))
fi

column_steps=1
if [ $columns -lt 155 ]; then
    column_steps=$((155 / columns))
fi

offset=0
for char in A B C D E F G H I J K L M N O P Q R S T U V W X Y Z; do
    printf "\e[H"
    for line in $(seq $lines); do
        for column in $(seq $columns); do
            index=$((line + column + offset))
            fg_col=$((index % 156 + 100))
            bg_col=$((255 - index % 156 + 100))
            printf "\e[38;5;$fg_col;48;5;$bg_col;1;3;4m$char"
        done
    done
    offset=$((offset + 1))
done