yhirose/cpp-linenoise

Multithreaded issue

zpalmtree opened this issue · 3 comments

Hiya,

When writing to the terminal on one thread, and reading on another with linenoise, output will be strangely indented.

The problem and patch is perfectly summed up in this thread - antirez/linenoise#128 - I wondered if you would be interested in applying the patch.

Thanks for the library by the way, it's far nicer to use than the C linenoise ❤️

@zpalmtree, the patch looks good to me. Could you try the patch (by just commenting out the line 1610) in your multi-threaded application? If you confirm it works with any problem, I'll commit the change right away. Thanks for your help!

@yhirose Thanks for the quick reply - since we're including just the header file in our application, that's what I went ahead and did, and it did correctly fix the issue. I wasn't sure if there could be any unexpected consequences from removing it, however.

@zpalmtree, thanks for the check. I'll go ahead committing it. If something happens with this change in the future, I'll think about it again to see whether I should revert it or find another solution. Thank you!