cpp-linenoise icon indicating copy to clipboard operation
cpp-linenoise copied to clipboard

TERM=null should be unsupported?

Open DomBlack opened this issue 7 years ago • 3 comments

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;

screen shot 2017-03-28 at 14 56 07

By making this small change, the CLion console works:

screen shot 2017-03-28 at 14 58 36

DomBlack avatar Mar 28 '17 13:03 DomBlack

@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

yhirose avatar Mar 28 '17 17:03 yhirose

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.

DomBlack avatar Mar 29 '17 08:03 DomBlack

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).

LoganDark avatar Oct 24 '18 15:10 LoganDark