Skip to content

Commit

Permalink
Merge branch 'status-hardReset' of https://github.com/mattirn/jline3
Browse files Browse the repository at this point in the history
…into mattirn-status-hardReset
  • Loading branch information
gnodet committed May 6, 2019
2 parents 795f2ea + fd94335 commit 7e08b92
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 @@ -1026,8 +1026,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 @@ -1039,7 +1044,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 7e08b92

Please sign in to comment.