GNU Readline (libreadline): Displaying output message asynchronously
问题 While using readline (blocking) for user input, I would like to output lines of text to the console asynchronously from another thread. Further, I would like that the readline prompt and current partial input line be removed from the console, the output line written, then the readline prompt and the partial user line restored - so as to give the appearance that the output was written "above" the prompt. By what combination of readline redisplay functions (or otherwise) can this be achieved?