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
26 changes: 26 additions & 0 deletions hooks/pane.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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])
})
4 changes: 3 additions & 1 deletion hooks/pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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($)
Expand Down
Loading