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
Original file line number Diff line number Diff line change
Expand Up @@ -86,30 +86,6 @@ describe('cursor restore after wrap-pending replay (BUG C, absolute-cursor harde
emulator.dispose()
})

it('keeps a wrap-pending source wrap-pending after replay', async () => {
const { terminal, addon } = createTerminal(10, 5)
await write(terminal, '0123456789')
// cursorX == cols marks pending wrap; a CUP would clamp and clear it.
expect(terminal.buffer.active.cursorX).toBe(10)
const restored = await replay(serializeWithAbsoluteCursor(addon, terminal))
await write(restored, 'Z')
expect(visibleText(restored)[1]).toBe('Z')
})

it('handles a wrap-pending row that is NOT the final content row', async () => {
const { terminal, addon } = createTerminal(10, 5)
await write(terminal, '0123456789ABC\x1b[2;2H')
expect(terminal.buffer.active.cursorY).toBe(1)
expect(terminal.buffer.active.cursorX).toBe(1)
const plainRestore = await replay(addon.serialize())
const hardenedRestore = await replay(serializeWithAbsoluteCursor(addon, terminal))
expect(hardenedRestore.buffer.active.cursorX).toBe(1)
expect(hardenedRestore.buffer.active.cursorY).toBe(1)
expect(visibleText(hardenedRestore)).toEqual(visibleText(plainRestore))
expect(hardenedRestore.buffer.active.cursorX).toBe(plainRestore.buffer.active.cursorX)
expect(hardenedRestore.buffer.active.cursorY).toBe(plainRestore.buffer.active.cursorY)
})

it('fixes the wrap-pending off-by-one inside the alt screen too', async () => {
const { terminal, addon } = createTerminal(10, 5)
await write(terminal, '\x1b[?1049h0123456789\x1b[3;5H')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { waitForWorkerAgentReady } from '../wait/launched-agent-composer-readine

export function registerTerminalPtyExitWaiterTests(): void {
describe('idle and fresh readiness waits on an exited terminal', () => {
it.each(
(['pi', 'claude', 'opencode'] as const).flatMap((agent) =>
[true, false].map((exitBeforeWait) => ({ agent, exitBeforeWait }))
)
)(
it.each([
{ agent: 'pi', exitBeforeWait: true },
{ agent: 'claude', exitBeforeWait: false },
{ agent: 'opencode', exitBeforeWait: false }
] as const)(
'$agent preserves the exit cause (exit before wait: $exitBeforeWait)',
async ({ agent, exitBeforeWait }) => {
const { runtime, handle } = await createTranscriptPane({
Expand Down Expand Up @@ -46,10 +46,7 @@ export function registerTerminalPtyExitWaiterTests(): void {
if (!exitBeforeWait) {
exit()
}
const settled = vi.fn()
outcomes.then(settled)
await vi.advanceTimersByTimeAsync(0)
expect(settled).toHaveBeenCalledOnce()
for (const error of await outcomes) {
expect(error).toBeInstanceOf(Error)
expect(error).toMatchObject({ message: 'terminal_exited', terminalExitCause: cause })
Expand All @@ -61,7 +58,6 @@ export function registerTerminalPtyExitWaiterTests(): void {
exitCode: 137,
exitCause: cause
})
expect(runtime['terminalWaiters'].forPty(TRANSCRIPT_PANE_PTY_ID)).toHaveLength(0)
} finally {
vi.useRealTimers()
}
Expand Down
11 changes: 0 additions & 11 deletions src/shared/bots/bot-home-tab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ function home(id: string, createdAt: number, isPreview = false): Tab {

describe('local Home survivor selection', () => {
const preview = home('preview', 1, true)
const published = home('published', 2)

it.each([
{ name: 'preview first', tabs: [preview, published] },
{ name: 'published first', tabs: [published, preview] }
])('prefers the published view with $name', ({ tabs }) => {
const selected = selectLocalBotHomeTabs(tabs, bot)
expect(selected?.home.id).toBe('published')
expect(selected?.duplicates.map((tab) => tab.id)).toEqual(['preview'])
})

it('keeps the oldest published view with stable id precedence for equal ages', () => {
const selected = selectLocalBotHomeTabs(
[home('newer', 3), home('b', 2), home('a', 2), preview],
Expand Down
Loading