bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-readline] Async printing to stdout while preserving prompt


From: Julian Scheid
Subject: Re: [Bug-readline] Async printing to stdout while preserving prompt
Date: Mon, 5 Oct 2009 03:17:52 +1300

On Mon, Oct 5, 2009 at 2:22 AM, Hans Lub <address@hidden> wrote:
> When select() returns with stdin readable, you just call
> rl_callback_read_char()

Thanks, but I have all that already working (I'm using liboop for the
asynchronous I/O and it has a readline adapter). My question is not
about I/O, only about display.

> When it returns with your other descriptor readable, you can read, and
> display the information as you see fit (possibly using rl_message)

I have tried with rl_message and it works as long as the prompt is on
a single line but the display seems to get messed up with prompts
spanning multiple rows. Specifically, I have tried:

      rl_save_prompt();
      rl_message("%s", text);
      rl_restore_prompt();
      rl_clear_message();

> If you moved the cursor you'll have to move it back to its original place,
> possibly with some "low level terminal interaction"  If you messed up the
> screen, you may have to call rl_redisplay()

I would like to avoid fiddling on the low level if possible. Is there
no way to do this otherwise?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]