Julian Scheid wrote:
> I am working on a command line application with an input loop driven
> by readline. The application can receive information asynchronously
> (not in direct response to commands entered via stdin) and I would
> like to display this information instantly while preserving the prompt
> and any text entered by the user on the prompt so far - just like
> <TAB><TAB> in bash will "push down" the prompt when printing available
> completions. Is this possible and if so, how can I achieve this
> without resorting to low-level terminal interaction?
>
> I have read about rl_save_prompt() and rl_restore_prompt() as well as
> rl_crlf() but it is unclear to me how I can clear the currently
> displayed prompt, especially if the prompt spans multiple screen rows.
In general, you don't want to if the prompt contains newlines -- you just
want to clear the portion after the final newline, since that's all
readline is going to consider and use. If it doesn't and the prompt is
just too long for the current screen width, you can use something like
rl_forced_update_display or rl_refresh_line after saving and restoring
the prompt.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline