Ticket #4655: scrolltest3.sh

File scrolltest3.sh, 579 bytes (added by joshe, 12 years ago)

Demonstrate the downward scrolling bug

Line 
1#!/bin/sh
2
3print_lines=25
4scroll_top=6
5scroll_bottom=22
6scroll_count=10
7
8i=1
9while [ $i -lt $print_lines ]
10do
11 printf '%2d\t' $i
12 j=0
13 while [ $j -lt $i ]
14 do
15 printf '*'
16 j=$(($j + 1))
17 done
18 printf '\n'
19 i=$(($i + 1))
20done
21
22printf 'about to scroll %d-%d down by %d... ' $scroll_top $scroll_bottom $scroll_count
23sleep 2
24
25# set scroll region
26printf "\e[${scroll_top};${scroll_bottom}r"
27
28# move to first line of scroll region
29printf "\e[${scroll_top};1H"
30
31# scroll down
32printf "\e[${scroll_count}L"
33
34sleep 2
35
36# clear scroll region
37printf '\e[r'