diff options
Diffstat (limited to 'page')
-rwxr-xr-x | page | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/page b/page deleted file mode 100755 index c478d7a..0000000 --- a/page +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # pager | ||
3 | |||
4 | . ./wrap | ||
5 | |||
6 | cleanup() { | ||
7 | tput reset | ||
8 | exit | ||
9 | } | ||
10 | |||
11 | refresh() { | ||
12 | shopt -s checkwinsize | ||
13 | ( | ||
14 | : | ||
15 | : | ||
16 | ) | ||
17 | printf '\e[?1049h\e?7l\e[2J\e[3;%sr\e[999H' "$((LINES - 1))" | ||
18 | } | ||
19 | |||
20 | resize() { | ||
21 | refresh | ||
22 | |||
23 | printf '\e7\e[?25l\e[H' | ||
24 | _wrap "$file" | ||
25 | printf '\e[999H\e[?25h' | ||
26 | } | ||
27 | |||
28 | _wrap() { | ||
29 | wrap "$COLUMNS" <"$1" | ||
30 | } | ||
31 | |||
32 | main() { | ||
33 | refresh | ||
34 | |||
35 | file="$1" | ||
36 | resize | ||
37 | |||
38 | trap resize WINCH | ||
39 | trap cleanup INT | ||
40 | |||
41 | while :; do | ||
42 | : | ||
43 | done | ||
44 | } | ||
45 | |||
46 | if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then | ||
47 | main "$@" | ||
48 | fi | ||