more about terminals

This commit is contained in:
2026-02-13 12:12:40 +01:00
parent dbc3736b34
commit efa05e3fb9
3 changed files with 211 additions and 21 deletions
+5 -1
View File
@@ -23,6 +23,10 @@ set -euo pipefail
# Ensure in a interactive terminal
[ ! -t 0 ] && exit 1
# Increase timeout for SSH sessions
TIMEOUT=0.3
[[ -n "${SSH_CONNECTION:-}" ]] && TIMEOUT=1.0
# Construct query
KGP_QUERY_ID=$RANDOM
KGP_QUERY_CODE=$(printf "\033_Gi=%d,s=1,v=1,a=q,t=d,f=24;AAAA\033\\" "$KGP_QUERY_ID")
@@ -44,7 +48,7 @@ support_sixel=0
response=""
while true; do
IFS= read -r -N 1 -t 0.3 char || {
IFS= read -r -N 1 -t "$TIMEOUT" char || {
[ -z "$char" ] && break
}