Skip to content

Instantly share code, notes, and snippets.

@agrif
Created May 7, 2013 14:21
Show Gist options
  • Select an option

  • Save agrif/5532914 to your computer and use it in GitHub Desktop.

Select an option

Save agrif/5532914 to your computer and use it in GitHub Desktop.
static void carl_async_print(print_func func, void* data)
{
char* saved_line;
int saved_point;
struct readline_state rlstate;
//saved_point = rl_point;
//saved_line = rl_copy_text(0, rl_end);
//rl_save_prompt();
rl_save_state(&rlstate);
rl_set_prompt("");
rl_replace_line("", 0);
rl_redisplay();
(*func)(data);
//rl_replace_line(saved_line, 0);
//rl_restore_prompt();
//rl_point = saved_point;
rl_restore_state(&rlstate);
rl_forced_update_display();
//free(saved_line);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment