2020-09-24 22:59:47 +02:00
|
|
|
#!/bin/bash
|
2020-07-31 16:39:16 +02:00
|
|
|
HOME=$(tput cup 0 0)
|
|
|
|
ED=$(tput ed)
|
|
|
|
EL=$(tput el)
|
|
|
|
printf '%s%s' "$HOME" "$ED"
|
2020-09-24 22:59:47 +02:00
|
|
|
|
|
|
|
cleanup(){
|
|
|
|
tput cnorm
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
trap cleanup INT
|
|
|
|
|
|
|
|
|
|
|
|
tput civis
|
2020-07-31 16:39:16 +02:00
|
|
|
while true
|
|
|
|
do
|
|
|
|
ROWS=$(tput lines)
|
|
|
|
COLS=$(tput cols)
|
|
|
|
CMD="$*"
|
|
|
|
${SHELL:=sh} -c "$CMD" | head -n $ROWS | while IFS= read LINE; do
|
|
|
|
printf '%-*.*s%s\n' $COLS $COLS "$LINE" "$EL"
|
|
|
|
done
|
|
|
|
printf '%s%s' "$ED" "$HOME"
|
2020-08-12 14:19:35 +02:00
|
|
|
sleep 0.2
|
2020-07-31 16:39:16 +02:00
|
|
|
done
|
2020-09-24 22:59:47 +02:00
|
|
|
tput cnorm
|