Skip to content

Commit 8385c7b

Browse files
committed
fix: flatten newlines in chatExchange CLI output
1 parent 1d87c61 commit 8385c7b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/ui.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ export function chatExchange(
8181
const actionSuffix = actionCount > 0
8282
? color.cyan(` [${actionCount} action${actionCount > 1 ? "s" : ""}]`)
8383
: "";
84+
const flatIn = inbound.replace(/\n/g, " ").replace(/\s+/g, " ").trim();
85+
const flatRe = reply.replace(/\n/g, " ").replace(/\s+/g, " ").trim();
8486
console.log(
85-
`${color.dim(ts)} (${shortFrom} → manager)${tColor}: ${inbound}\n` +
86-
`${color.dim(ts)} (manager → ${shortFrom})${tColor}: ${reply}${actionSuffix}`
87+
`${color.dim(ts)} (${shortFrom} → manager)${tColor}: ${flatIn}\n` +
88+
`${color.dim(ts)} (manager → ${shortFrom})${tColor}: ${flatRe}${actionSuffix}`
8789
);
8890
}
8991

0 commit comments

Comments
 (0)