linenoise
linenoise copied to clipboard
TERM=null likely means no escape sequence support
Currently if the TERM is null, it is counted as a terminal which supports escape sequences. However if no TERM is set, the likelihood is that escape sequences are not supported.
For instance CLion's integrated terminate does not support escape sequences and does not set a TERM.
With this change an application goes from displaying:
To displaying:
Hello, thanks for your contrib, I hope that we don't break other systems with TERM set to NULL but actually having escape sequences. Isn't there another discriminant we can use? For instance, even if it's not a terminal, it still returns true to isatty()? Thanks.
Yes it turns true for isatty(0)
This is a useful fix for the but needs updated to use isatty(0)
instead of (only) checking if TERM is NULL.
Needs work before merge!