fix(coding-agent): strip fake cursor markers in OAuth prompt regression test

This commit is contained in:
Armin Ronacher 2026-10-08 09:54:07 +02:00
parent 1cedd32724
commit 21d1dcd4d4

View file

@ -19,7 +19,13 @@ function createDialog(): LoginDialogComponent {
}
function renderDialog(dialog: LoginDialogComponent): string[] {
return stripAnsi(dialog.render(120).join("\n"))
// stripAnsi keeps APC sequences, so drop the TUI's zero-width cursor markers (e.g. \x1b_pi:fc\x07) first
return stripAnsi(
dialog
.render(120)
.join("\n")
.replace(/\x1b_[^\x07]*\x07/g, ""),
)
.split("\n")
.map((line) => line.trimEnd());
}