Fix terminal read for blank TUI tails (#5050)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -1348,6 +1348,42 @@ describe('orca cli worktree awareness', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('prints terminal.read fallback screen lines in json mode', async () => {
|
||||
queueFixtures(
|
||||
callMock,
|
||||
okFixture('req_terminal_read', {
|
||||
terminal: {
|
||||
handle: 'term_worker',
|
||||
status: 'running',
|
||||
tail: ['Claude Code', 'Checking files', 'Waiting for input'],
|
||||
truncated: false,
|
||||
limited: true,
|
||||
oldestCursor: '0',
|
||||
nextCursor: '3000',
|
||||
latestCursor: '3000',
|
||||
returnedLineCount: 3
|
||||
}
|
||||
})
|
||||
)
|
||||
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {})
|
||||
|
||||
await main(
|
||||
['terminal', 'read', '--terminal', 'term_worker', '--limit', '120', '--json'],
|
||||
'/tmp/repo'
|
||||
)
|
||||
|
||||
expect(callMock).toHaveBeenCalledWith('terminal.read', {
|
||||
terminal: 'term_worker',
|
||||
limit: 120
|
||||
})
|
||||
const printed = JSON.parse(String(logSpy.mock.calls[0]?.[0]))
|
||||
expect(printed.result.terminal.tail).toEqual([
|
||||
'Claude Code',
|
||||
'Checking files',
|
||||
'Waiting for input'
|
||||
])
|
||||
})
|
||||
|
||||
it('keeps interactive Codex startup commands backgrounded unless focus is explicit', async () => {
|
||||
queueFixtures(
|
||||
callMock,
|
||||
|
||||
Reference in New Issue
Block a user