diff --git a/packages/cli/tests/pty-screen.test.ts b/packages/cli/tests/pty-screen.test.ts new file mode 100644 index 0000000..4470149 --- /dev/null +++ b/packages/cli/tests/pty-screen.test.ts @@ -0,0 +1,7 @@ +import { lastPromptLine } from './pty/screen.js' + +describe('PTY prompt detection', () => { + it('recognizes the legacy Windows prompt arrow inside Unicode box rails', () => { + expect(lastPromptLine(['╭────╮', '│ > │', '╰────╯'])).toBe('│ > │') + }) +}) diff --git a/packages/cli/tests/pty/screen.ts b/packages/cli/tests/pty/screen.ts index 6182400..fb8213a 100644 --- a/packages/cli/tests/pty/screen.ts +++ b/packages/cli/tests/pty/screen.ts @@ -32,7 +32,7 @@ export function lastPromptLine(lines: string[]): string { // Boxed prompt: `│ › …… │` — the rails are part of the live input box. // Permission-dialog option rows also start with `│ ` but their pointer // sits behind a 4-space indent, so they can't false-match `│ ›`. - if (line.startsWith('│ ›') || line.startsWith('| >')) return line + if (line.startsWith('│ ›') || line.startsWith('│ >') || line.startsWith('| >')) return line } return '' }