Skip to content

Commit 7c2a36b

Browse files
authored
refactor: use console.clear to clear the log (#5700)
Co-authored-by: chentao.arthur <[email protected]>
1 parent 8f5691b commit 7c2a36b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/@vue/cli-shared-utils/lib/logger.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const chalk = require('chalk')
22
const stripAnsi = require('strip-ansi')
3-
const readline = require('readline')
43
const EventEmitter = require('events')
54

65
const { stopSpinner } = require('./spinner')
@@ -59,10 +58,7 @@ exports.error = (msg, tag = null) => {
5958

6059
exports.clearConsole = title => {
6160
if (process.stdout.isTTY) {
62-
const blank = '\n'.repeat(process.stdout.rows)
63-
console.log(blank)
64-
readline.cursorTo(process.stdout, 0, 0)
65-
readline.clearScreenDown(process.stdout)
61+
console.clear()
6662
if (title) {
6763
console.log(title)
6864
}

0 commit comments

Comments
 (0)