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
7 changes: 7 additions & 0 deletions packages/cli/tests/pty-screen.test.ts
Original file line number Diff line number Diff line change
@@ -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('│ > │')
})
})
2 changes: 1 addition & 1 deletion packages/cli/tests/pty/screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
}
Expand Down
Loading