Ticket #4651: scrolltest.sh

File scrolltest.sh, 553 bytes (added by joshe, 15 years ago)

Demonstrate the scroll region bug

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