Maybe this is unrelated... but are you making console chat?
I did a really stupid work around where I would read from stdin with "getch" in a different thread and poll for it in the main thread.
I did this so that i could have console chat. So as you type messages other messages could come in front of what you where typing. This requires erasing what you are typing, printing the new message, putting what you where typing and putting the cursor back.
https://github.com/treeform/netpipe/blob/master/tests/chatclientthreads.nim#L24