Return the number of bytes that compose the UTF-8 character starting at * 'c'. This function assumes a valid UTF-8 encoding and handles the four * standard byte patterns: * 0xxxxxxx -> 1 byte (ASCII) * 110xxxxx -> 2 bytes * 1110xxxx -> 3 bytes * 11110xxx -> 4 bytes */
| 157 | terminal_update.fd = fd; |
| 158 | terminal_update.len = 0; |
| 159 | linenoiseWrite(fd, "\x1b[?2026h", 8); |
| 160 | } |
| 161 | |
| 162 | void linenoiseEndUpdate(void) { |
| 163 | if (!terminal_update.depth || terminal_update.depth > 1) { |
| 164 | if (terminal_update.depth) terminal_update.depth--; |
| 165 | return; |
| 166 | } |
| 167 | linenoiseWrite(terminal_update.fd, "\x1b[?2026l", 8); |
| 168 | terminal_update.depth = 0; |
| 169 | terminalWrite(terminal_update.fd, terminal_update.text, terminal_update.len); |