diff options
Diffstat (limited to 'src/write-tty')
-rw-r--r-- | src/write-tty | 19 |
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 | ||
121 | output_filter | 114 | output_filter |