Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/utils/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,8 @@ class Progress {
if (!this.#rendered) {
return
}
// Move to the start of the line and clear the rest of the line
this.#stream.cursorTo(0)
this.#stream.clearLine(1)
// Erase the last printed character
this.#stream.write('\b \b')
this.#rendered = false
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/lib/utils/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ t.test('can do progress', async (t) => {
log.error('', 'after input')
output.standard('after input')

t.strictSame([...new Set(outputErrors)].sort(), ['-', '/', '\\', '|'])
t.strictSame([...new Set(outputErrors)].sort(), ['\b \b', '-', '/', '\\', '|'])
t.strictSame(logs, ['error before input', 'error during input', 'error after input'])
t.strictSame(outputs, ['before input', 'during input', 'after input'])
})
Expand Down