Skip to content

Commit

Permalink
fix: Remove negative count in stdout with 0 rows (#1983)
Browse files Browse the repository at this point in the history
close #1981
  • Loading branch information
alykamb committed Feb 11, 2021
1 parent 108be94 commit 09b13ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ let lastMsg: string | undefined
let sameCount = 0

function clearScreen() {
const blank = '\n'.repeat(process.stdout.rows - 2)
const repeatCount = process.stdout.rows - 2
const blank = repeatCount > 0 ? '\n'.repeat(repeatCount) : ''
console.log(blank)
readline.cursorTo(process.stdout, 0, 0)
readline.clearScreenDown(process.stdout)
Expand Down

0 comments on commit 09b13ed

Please sign in to comment.