Skip to content

Commit

Permalink
fix: πŸ› properly clear down and reset cursor to [0,0] on terminal resize
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Mar 4, 2020
1 parent 693ace4 commit c3addab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export class Terminal {
if (this.resized) {
this.lines = []
this.resized = false
readline.moveCursor(this.stream, 0, -this.lines.length + 1)
readline.cursorTo(this.stream, 0)
readline.clearScreenDown(this.stream)
}
const lines = Array.isArray(text) ? text : text.split("\n")

Expand Down

0 comments on commit c3addab

Please sign in to comment.