Skip to content

Commit

Permalink
Handle SIGWINCH while calling move_cursor_at_leftmost
Browse files Browse the repository at this point in the history
May fix kkawakam#402
  • Loading branch information
gwenn committed Jul 26, 2020
1 parent 7fe1925 commit a6add02
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,14 @@ fn readline_edit<H: Helper>(

let mut rdr = editor.term.create_reader(&editor.config)?;
if editor.term.is_output_tty() {
s.move_cursor_at_leftmost(&mut rdr)?;
let rc = s.move_cursor_at_leftmost(&mut rdr);
if let Err(e) = rc {
if s.out.sigwinch() {
s.out.update_size();
} else {
return Err(e);
}
}
}
s.refresh_line()?;

Expand Down

0 comments on commit a6add02

Please sign in to comment.