Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/terminal/ansi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const keyCtrlD = String.fromCharCode(4);
const saveScreen = CSI + "?47h";
const restoreScreen = CSI + "?47l";
const clearScreen = CSI + "2J";
export const enableWin32InputMode = CSI + "?9001h";
const cursorTo = (x: number, y: number) => {
return CSI + (y + 1) + SEP + (x + 1) + "H";
};
Expand Down
15 changes: 14 additions & 1 deletion src/trace/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import zlib from "node:zlib";
import process from "node:process";
import fsAsync from "node:fs/promises";
import { promisify } from "node:util";
import { enableWin32InputMode } from "../terminal/ansi.js";

export type TracePoint = DataTracePoint | SizeTracePoint;

Expand Down Expand Up @@ -75,8 +76,20 @@ export const saveTrace = async (
if (!fs.existsSync(traceFolder)) {
await fsAsync.mkdir(traceFolder, { recursive: true });
}

// remove win32-input-mode enable sequence if it comes through data
const cleanedTracePoints = tracePoints.map((tracePoint) => {
if ("data" in tracePoint) {
return {
...tracePoint,
data: tracePoint.data.replaceAll(enableWin32InputMode, ""),
};
}
return tracePoint;
});

const trace: Trace = {
tracePoints,
tracePoints: cleanedTracePoints,
attempt,
...testName(testId),
};
Expand Down