mirror of
https://git.phreedom.club/localhost_frssoft/bbs-telnet
synced 2024-11-23 21:19:22 +02:00
impoved output line by line mode
This commit is contained in:
parent
870461bf7a
commit
c0a33acff6
|
@ -19,6 +19,8 @@ generator_session=$(zcat -f $system_dict | shuf -n 2 | tr -d "\n'")
|
||||||
randpadding=$(head -c 8 /dev/urandom | base64)
|
randpadding=$(head -c 8 /dev/urandom | base64)
|
||||||
printf "$randpadding\t$generator_session\n"
|
printf "$randpadding\t$generator_session\n"
|
||||||
|
|
||||||
|
rewrite_line() { printf "\r\033[1A\033[0K%s" "$@"; }
|
||||||
|
|
||||||
while read -r cmd mesg; do
|
while read -r cmd mesg; do
|
||||||
if [ "$cmd" = "reg" ]; then
|
if [ "$cmd" = "reg" ]; then
|
||||||
key=$(echo "$mesg" | cut -d' ' -f 2)
|
key=$(echo "$mesg" | cut -d' ' -f 2)
|
||||||
|
@ -51,7 +53,9 @@ while read -r cmd mesg; do
|
||||||
tlhome=$(timeline_home "$mesg")
|
tlhome=$(timeline_home "$mesg")
|
||||||
tlhome_len=$(echo "$tlhome" | wc -l)
|
tlhome_len=$(echo "$tlhome" | wc -l)
|
||||||
current_pos=1
|
current_pos=1
|
||||||
|
echo "-- tl home view ($tlhome_len lines)--"
|
||||||
while read -r cursor; do
|
while read -r cursor; do
|
||||||
|
rewrite_line
|
||||||
if [ ':q' = "$cursor" ]; then break; fi
|
if [ ':q' = "$cursor" ]; then break; fi
|
||||||
if [ ':all' = "$cursor" ]; then echo "$tlhome"; break; fi
|
if [ ':all' = "$cursor" ]; then echo "$tlhome"; break; fi
|
||||||
echo "$tlhome" | awk "NR==$current_pos"
|
echo "$tlhome" | awk "NR==$current_pos"
|
||||||
|
|
Loading…
Reference in New Issue