Skip to content

Commit

Permalink
Fix line count
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Jan 19, 2025
1 parent 29192a8 commit 2624c4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/watch/spinners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import process from "node:process";
import type { WriteStream } from "node:tty";
import { stripVTControlCharacters } from "util";
import yoctocolors from "yoctocolors";

const isUnicodeSupported =
Expand Down Expand Up @@ -254,7 +255,7 @@ class Spinners<Key extends string = string> {

private lineCount(text: string) {
const width = this.stream.columns ?? 80;
const lines = text.split("\n");
const lines = stripVTControlCharacters(text).split("\n");

let lineCount = 0;
for (const line of lines) {
Expand Down

0 comments on commit 2624c4e

Please sign in to comment.