Skip to content

Commit

Permalink
Custom redisplay functions don't redraw multi-line prompts correctly …
Browse files Browse the repository at this point in the history
…on terminal resize (fixes #352).
  • Loading branch information
mridgers committed Dec 28, 2015
1 parent 6bee9fd commit d68d0e2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clink/dll/getc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ static void simulate_sigwinch()
FillConsoleOutputAttribute(handle, csbi.wAttributes, cell_count, cursor_pos,
&written);

// Tell Readline the buffer's resized.
rl_resize_terminal();
// Tell Readline the buffer's resized, but make sure we don't use Clink's
// redisplay path as then Readline won't redisplay multiline prompts correctly.
{
rl_voidfunc_t* old_redisplay = rl_redisplay_function;
rl_redisplay_function = rl_redisplay;

rl_resize_terminal();

rl_redisplay_function = old_redisplay;
}
}

//------------------------------------------------------------------------------
Expand Down

0 comments on commit d68d0e2

Please sign in to comment.