Skip to content

Commit

Permalink
redisplay prompt and partial input after resume
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 29, 2012
1 parent ca8ad23 commit 1bf4250
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ui/repl-readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ static int down_callback(int count, int key) {
}
}

static int callback_en=0;

void jl_input_line_callback(char *input)
{
int end=0, doprint=1;
Expand All @@ -336,6 +338,7 @@ void jl_input_line_callback(char *input)
free(input);
}

callback_en = 0;
rl_callback_handler_remove();
handle_input(rl_ast, end, doprint);
}
Expand Down Expand Up @@ -463,6 +466,8 @@ void sigtstp_handler(int arg)
void sigcont_handler(int arg)
{
rl_reset_after_signal();
if (callback_en)
rl_forced_update_display();
}

static void init_rl(void)
Expand Down Expand Up @@ -503,10 +508,12 @@ void init_repl_environment(void)

void repl_callback_enable()
{
callback_en = 1;
rl_callback_handler_install(prompt_string, jl_input_line_callback);
}

void jl_stdin_callback(void)
{
rl_callback_read_char();
if (callback_en)
rl_callback_read_char();
}

0 comments on commit 1bf4250

Please sign in to comment.