cpp-linenoise
cpp-linenoise copied to clipboard
TERM=null should be unsupported?
In isUnsupportedTerm
I suggest changing it to:
if (term == NULL) return true;
This is mainly because CLion's integrated console does not set TERM
and does not work with line noise or cpp-linenoise. Instead of getting the prompt we the following noise, plus the enter key is not picked up - so readline never exits;
By making this small change, the CLion console works:
@DomBlack, thanks for the problem report.
Your suggestion looks totally reasonable to me. But If it happens with 'antirez/linenoise' as well, I am tending to leave it as it is, since I would like to keep the cpp-linenoise code as close to the original linenoise as possible.
I just found the stackoverflow article which seems to solve the problem on CLion's side. Does this solution work for you? http://stackoverflow.com/questions/42263743/how-to-properly-set-environment-variable-term-in-clion
I'm submitted it as a PR (antirez/linenoise#137) for line noise. Hopefully it gets merged as out of the box support would be nice.
If I set the TERM environmental to "dumb" or one of the other unsupported terms, then yes it works. However, let's see if the PR get's accepted.
IMHO, I wouldn't use CLion's integrated "console" (run command). I always build first (Command+F9) and then use a/the terminal, because the "console" uses a hijacked textarea (you know, the thing the code editor uses).