From 80151ca1d65348b8b4248fcc4fd025a1ee734ea0 Mon Sep 17 00:00:00 2001 From: Minsang Kim Date: Wed, 26 Jul 2023 00:18:06 +0900 Subject: [PATCH] fix: misaligning CJK characters --- src/Spinner.class.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Spinner.class.ts b/src/Spinner.class.ts index 70d2ae2..3c3bee5 100644 --- a/src/Spinner.class.ts +++ b/src/Spinner.class.ts @@ -153,7 +153,7 @@ export class Spinner extends EventEmitter { const line = this.#lineToRender(spinnerSymbol); readline.clearLine(this.stream, 0); this.stream.write(line); - readline.moveCursor(this.stream, -line.length, moveCursorPos); + readline.moveCursor(this.stream, -(wcwidth(line)), moveCursorPos); } start(text?: string, options: IStartOptions = {}) {