Skip to content

Commit

Permalink
invoke status.hardReset() after resizing terminal window
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed May 5, 2019
1 parent d862e3e commit fd94335
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,13 @@ protected String finishBuffer() {

protected void handleSignal(Signal signal) {
if (signal == Signal.WINCH) {
Status status = Status.getStatus(terminal, false);
if (status != null) {
status.hardReset();
}
size.copy(terminal.getBufferSize());
display.resize(size.getRows(), size.getColumns());
redrawLine();
redisplay();
}
else if (signal == Signal.CONT) {
Expand All @@ -1034,7 +1039,7 @@ else if (signal == Signal.CONT) {
redisplay();
}
}

@SuppressWarnings("unchecked")
protected Widget getWidget(Object binding) {
Widget w;
Expand Down
6 changes: 6 additions & 0 deletions terminal/src/main/java/org/jline/utils/Status.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ public void reset() {
this.force = true;
}

public void hardReset() {
List<AttributedString> lines = new ArrayList<>(oldLines);
update(null);
update(lines);
}

public void redraw() {
update(oldLines);
}
Expand Down

0 comments on commit fd94335

Please sign in to comment.