Open ssshake opened 5 years ago
Hi,
flush() function writes to output channel all characters that could have been buffered until that moment.
resetInput() acts as "reset keyboard buffer" (so it's related to input channel), it's useful before getting an input from keyboard, with readKey or readLine()
Hope it helps!
It does help.
What are the potential consequences of not using either?
I've realized in my code I am using (or rather not using) these haphazardly and without any thought or understanding.
Everything seems to be behaving fine but I'm guessing there is some nuance there depending on my connection quality and terminal client.
It depends on the client used. For example, if I don't user flush(), sometimes using SyncTerm some characters are "retained" till some other char comes.
OK got it, thanks!
I've been trying to understand when these need to be used and what they do but I don't follow it.
Could you give me some guidance on when to use either of these and why. Thanks!