Skip to content

Commit

Permalink
Clear characters better
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Apr 13, 2021
1 parent b582d01 commit b6445aa
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class AeshConsole extends QuarkusConsole {
private String statusMessage;
private String promptMessage;
private int totalStatusLines = 0;
private String emptyLine;
private int lastWriteCursorX;

public AeshConsole(Connection connection) {
Expand Down Expand Up @@ -116,12 +115,6 @@ public void run() {
}
});

StringBuilder line = new StringBuilder();
for (int i = 0; i < size.getWidth(); ++i) {
line.append(" ");
}
emptyLine = line.toString();

conn.setCloseHandler(close -> end(conn));
conn.setSizeHandler(size -> setup(conn));

Expand Down Expand Up @@ -166,9 +159,7 @@ private void printStatusAndPrompt(StringBuilder buffer) {

private void clearStatusMessages(StringBuilder buffer) {
gotoLine(buffer, size.getHeight() - totalStatusLines);
for (int i = 0; i <= totalStatusLines; ++i) {
buffer.append(emptyLine);
}
buffer.append("\033[J");
}

private StringBuilder gotoLine(StringBuilder builder, int line) {
Expand Down

0 comments on commit b6445aa

Please sign in to comment.