c++ - Prevent mixing of console output and written text -
i have c++ console application prints output while accepts commands (using std::cin
) user - output , input happen in separate threads.
if write text while output appears written text mixed application output. how can prevent behaviour?
to solve problem, need display program one line above line text typed. i'd inspire myself in minecraft bukkit server's solution - need same c++.
assuming want output appear while things being typed, you'll need screen control facilities have output go somewhere different input area. if tasked implement writing terminal refresh ncurses experience. realize on windows console , have no idea if windows console capable of screen control needed make happen.
you can possibly tie custom stream buffers std::cin
, std::cout
using curses functionality under hood may not worth it. in case, isn't entirely trivial.
Comments
Post a Comment