diff --git a/hooks/pane.test.tsx b/hooks/pane.test.tsx index 4c3b3a9..3a2f2ef 100644 --- a/hooks/pane.test.tsx +++ b/hooks/pane.test.tsx @@ -187,3 +187,29 @@ test('the pane lists the earlier sessions of the project, and pressing one shows expect(await ui.find({ type: 'Text', text: /earlier session text/ })).toBeDefined() await ui.unmount() }) + +test('/minos opens the pane transparent, on the terminal background as the chat is', async ($, on) => { + engine(on, cli) + const backgrounds: (string | undefined)[] = [] + on('ui.open', (_$, e) => { + backgrounds.push((e as { backgroundColor?: string }).backgroundColor) + return { value: { isPlaced: true } } + }) + await start($) + await $.command.run(OPEN) + expect(backgrounds).toEqual(['transparent']) +}) + +test('a Claude Code that refuses backgroundColor still opens the pane, on its own fill', async ($, on) => { + engine(on, cli) + const backgrounds: (string | undefined)[] = [] + on('ui.open', (_$, e) => { + const background = (e as { backgroundColor?: string }).backgroundColor + if (background !== undefined) return { deny: 'unknown option backgroundColor' } + backgrounds.push(background) + return { value: { isPlaced: true } } + }) + await start($) + expect(JSON.stringify(await $.command.run(OPEN))).toContain('Minos pane opened.') + expect(backgrounds).toEqual([undefined]) +}) diff --git a/hooks/pane.tsx b/hooks/pane.tsx index ce3d859..cf2e48e 100644 --- a/hooks/pane.tsx +++ b/hooks/pane.tsx @@ -224,7 +224,9 @@ const style = (s: Segment) => ({ export function livePane(on: On): void { on('command.run', { command: COMMAND }, async ($) => { await update($, isOpen, () => true) - await $.ui.open({ id: PANE, title: 'Minos' }) + // Transparent: the pane lies on the terminal's own background, as the chat beside it does. + // A Claude Code from before `backgroundColor` refuses it, and gets the pane on its own fill. + await $.ui.open({ id: PANE, title: 'Minos', backgroundColor: 'transparent' }).catch(() => $.ui.open({ id: PANE, title: 'Minos' })) void refresh($) void readProject($) void readHead($)