Files
orca/src/cli/terminal-format-draft.test.ts
T
Brennan Benson 419e3b4496 Fix terminal reads that flatten composer drafts into output (#16711)
* fix(terminal): separate composer drafts from read output

Rendered screen reads treated cursor-line suggestion overlays as PTY output. Detect composer-owned text from cell attributes and cursor context, remove it from tail, and expose it as structured draft metadata.

* fix(terminal): handle wrapped composer overlays

* fix(terminal): preserve draft wrapping and tail alignment

* fix(terminal): preserve composer wrap boundaries

* fix(terminal): preserve draft continuations with middle dots

* fix(terminal): recognize configurable Codex status lines
2026-08-27 15:28:09 -07:00

22 lines
635 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest'
import { formatTerminalRead } from './terminal-format'
describe('formatTerminalRead draft separation', () => {
it('labels composer drafts outside terminal output', () => {
const output = formatTerminalRead({
terminal: {
handle: 'term_1',
status: 'running',
tail: ['Build passed', '❯'],
truncated: false,
nextCursor: null,
source: 'screen',
draft: 'proceed with the release'
}
})
expect(output).toContain('draft: "proceed with the release"')
expect(output).toContain('\n\nBuild passed\n❯')
})
})