Skip to content

Commit 069432e

Browse files
committed
fix: Strip ANSI formatting characters
1 parent 0d7ae7c commit 069432e

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "clifty-monorepo",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"description": "A CLI orchestration and testing tool - monorepo",
55
"repository": {
66
"type": "git",

packages/clifty/src/scenarioBuilder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
InteractionBuilder,
66
TestEnv,
77
} from "./types.js";
8+
import { stripVTControlCharacters } from "node:util";
89

910
const DEFAULT_STEP_TIMEOUT = 10_000;
1011

@@ -157,7 +158,7 @@ export class ScenarioBuilder implements InteractionBuilder {
157158
}
158159

159160
child.stdout.on("data", (data) => {
160-
this.#stdoutBuffer += data.toString();
161+
this.#stdoutBuffer += stripVTControlCharacters(data.toString());
161162
this.output.dispatchEvent(
162163
new CustomEvent("stdout", { detail: data.toString() })
163164
);
@@ -167,7 +168,7 @@ export class ScenarioBuilder implements InteractionBuilder {
167168
});
168169

169170
child.stderr.on("data", (data) => {
170-
this.#stdErrBuffer += data.toString();
171+
this.#stdErrBuffer += stripVTControlCharacters(data.toString());
171172
this.output.dispatchEvent(
172173
new CustomEvent("stderr", { detail: data.toString() })
173174
);

0 commit comments

Comments
 (0)