diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2019-09-25 16:48:35 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2019-09-25 16:48:35 +0300 |
| commit | 0fec0f70a3f828893e737f7283f0ecc69752dbee (patch) | |
| tree | 6ecb1741a6013e9ea959fb5be6009df94cf69d1d | |
| parent | 4157b94228fcdea62c9c6362de582019392dfcee (diff) | |
| download | pfetch-0fec0f70a3f828893e737f7283f0ecc69752dbee.tar.gz | |
pfetch: fix seq not posix
| -rwxr-xr-x | pfetch | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -932,10 +932,13 @@ main() { # art in height, don't touch the cursor, else move it down N lines. cursor_pos=$((info_height > ascii_height ? 0 : ascii_height - info_height)) - # Print '$cursor_pos' amount of newlines. Using cursor down doesn't scroll - # the screen correctly if this causes the cursor to hit the bottom of the - # window. Using '0' gives us an extra iteration, adding a bottom line gap. - printf '%0.s\n' $(seq 0 "$cursor_pos") >&6 + # Print '$cursor_pos' amount of newlines to correctly position the + # cursor. This used to be a 'printf $(seq X X)' however 'seq' is only + # typically available (by default) on GNU based systems! + while [ "${i:-0}" -le "$cursor_pos" ]; do + printf '\n' + : $((i+=1)) + done >&6 } main "$@" |
