test: stabilize bash send-keys submit

This commit is contained in:
Peter Steinberger
2026-01-17 07:41:10 +00:00
parent c92265a51b
commit 78a4441ac2
2 changed files with 3 additions and 2 deletions

View File

@@ -45,12 +45,12 @@ test("process send-keys encodes Enter for pty sessions", async () => {
throw new Error("PTY session did not exit after send-keys");
});
test("process submit sends CR for pty sessions", async () => {
test("process submit sends Enter for pty sessions", async () => {
const execTool = createExecTool();
const processTool = createProcessTool();
const result = await execTool.execute("toolcall", {
command:
"node -e \"process.stdin.on('data', d => { if (d.includes(13)) { process.stdout.write('submitted'); process.exit(0); } });\"",
"node -e \"process.stdin.on('data', d => { if (d.includes(10) || d.includes(13)) { process.stdout.write('submitted'); process.exit(0); } });\"",
pty: true,
background: true,
});

View File

@@ -1,3 +1,4 @@
// eslint-disable-next-line no-control-regex
const DSR_PATTERN = /\x1b\[\??6n/g;
export function stripDsrRequests(input: string): { cleaned: string; requests: number } {