From a8feb7ca5ac0af329aa0c69591878b442f8a8539 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Sat, 20 Sep 2025 12:01:59 -0400 Subject: [PATCH] implement STAT, allow unclosed sixels --- ntalk.tcl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ntalk.tcl b/ntalk.tcl index f9363d580aa18263373887b769394233931519fe..154cc42fea0e6e6f6460e8904da9f04ba4973159 100755 --- a/ntalk.tcl +++ b/ntalk.tcl @@ -130,12 +130,14 @@ make16 frame .foot entry .foot.input label .foot.msgs -textvariable lastmsg +label .foot.sep -text " // " +label .foot.ppl -textvariable clients label .foot.name scrollbar .scroll -command {.buffer yview} text .buffer -width 72 -yscrollcommand {.scroll set} -pack .foot.msgs -side right +pack .foot.ppl .foot.sep .foot.msgs -side right pack .foot.name -side left pack .foot.input -side bottom -fill x @@ -268,7 +270,7 @@ proc bufpush {line} { # get the sixels set idx1 $idx2 set idx2 [string first ")" $line $idx1+2] - if {$idx2 == -1} break + if {$idx2 == -1} { set idx2 [string length $line] } # insert them .buffer insert end [string range $line $idx1 $idx2] rawsixel @@ -327,6 +329,15 @@ proc quit {} { exit 0 } +proc stat {} { + global clients + + sendl STAT + lassign [recvl] msgs + lassign [recvl] bytes + lassign [recvl] clients +} + ### ACTUAL CLIENT CODE LMAO ### @@ -340,6 +351,7 @@ proc sendmsg {msg} { } proc pollmsgs {} { + stat skip after 10000 pollmsgs } @@ -349,6 +361,7 @@ proc pollmsgs {} { set lastmsg 0 last 16 +stat after 10000 pollmsgs bind .foot.input [concat [bind .foot.input ] ";" {