summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2024-08-30 10:10:11 -0400
committerAndrew Cady <d@jerkface.net>2024-08-30 10:10:11 -0400
commitb941676fe7a11af4bfdf3bde99ca597c32dea7d0 (patch)
tree891636df026ad902716e9700d4cba7f00c0a88b4
parent2f9fde5ac8a14ba6be7c5ec2ef95735fd94ec73c (diff)
fix unicode non-printing
-rw-r--r--src/write-tty19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/write-tty b/src/write-tty
index 60046e1..7403006 100644
--- a/src/write-tty
+++ b/src/write-tty
@@ -71,12 +71,7 @@ tokenize()
71 then 71 then
72 printf '\\%.3o\n' "'$REPLY" 72 printf '\\%.3o\n' "'$REPLY"
73 else 73 else
74 hexdigits=$(LC_ALL=C; for ((i=0; i<$bytelen; ++i)) 74 printf '\\U%.8x\n' "'$REPLY"
75 do
76 printf '%.2x' "'${REPLY:$i:1}"
77 printf '%.2x\n' "'${REPLY:$i:1}" >&2
78 done)
79 printf '%s%.8x\n' '\U' 0x"$hexdigits"
80 fi 75 fi
81 else 76 else
82 printf '\\%.3o\n' 0 77 printf '\\%.3o\n' 0
@@ -108,14 +103,12 @@ soft_cursor()
108 do 103 do
109 read -r replycolor REPLY || break 104 read -r replycolor REPLY || break
110 replylen=${#REPLY} 105 replylen=${#REPLY}
111 case "$replycolor" in 106 if (( $replycolor > 0 ))
112 0 ) 107 then
113 ;; 108 printf -v REPLY '\e[%sm%s\e[m' "$replycolor" "$REPLY"
114 * ) 109 fi
115 REPLY=$'\e['"$replycolor"'m'"$REPLY"$'\e[m'
116 ;;
117 esac
118 done 110 done
111 printf ' \b\n'
119} 112}
120 113
121output_filter 114output_filter