14 if (!input || input_len == 0) {
23 while (i < input_len) {
25 if (input[i] ==
'\x1b' && i + 1 < input_len && input[i + 1] ==
'[') {
30 while (i < input_len) {
34 if ((c >= 0x30 && c <= 0x3F) || (c >= 0x20 && c <= 0x2F)) {
43 char final = input[i];
44 if (
final >= 0x40 &&
final <= 0x7E) {
char * ansi_strip_escapes(const char *input, size_t input_len)
Strip all ANSI escape sequences from a string.
ANSI escape sequence utilities.
void ob_term(outbuf_t *ob)
Append null terminator to buffer.
void ob_putc(outbuf_t *ob, char c)
Append a character to buffer.
void ob_reserve(outbuf_t *ob, size_t need)
Reserve buffer space for upcoming writes.
Dynamic Output Buffer with ANSI Sequence Support.
Dynamic output buffer (auto-expanding)
char * buf
Buffer pointer (allocated, owned by caller, must be freed)