GNU Readline: how to clear the input line?

前端 未结 6 1395
你的背包
你的背包 2021-01-05 14:35

I use GNU Readline in the \"select\" fashion, by registering a callback function like so:

rl_callback_handler_install(\"\", on_readline_input);
6条回答
  •  忘掉有多难
    2021-01-05 15:21

    This also seems to work:

    rl_clear_visible_line();
    printf(...);
    rl_reset_line_state();
    rl_redisplay();
    

提交回复
热议问题