hermes-agent/ui-tui/packages/hermes-ink/src/ink/terminal.test.ts
Brooklyn Nicholson 279b656adc fix(tui): clear Apple Terminal resize artifacts
Use a deeper alt-screen clear for Apple Terminal resize repaints so host reflow artifacts do not survive the recovery frame.
2026-05-03 12:11:24 -05:00

15 lines
691 B
TypeScript

import { describe, expect, it } from 'vitest'
import { needsAltScreenResizeScrollbackClear } from './terminal.js'
describe('terminal resize quirks', () => {
it('uses a deeper alt-screen resize clear for Apple Terminal', () => {
expect(needsAltScreenResizeScrollbackClear({ TERM_PROGRAM: 'Apple_Terminal' })).toBe(true)
expect(needsAltScreenResizeScrollbackClear({ TERM_PROGRAM: ' Apple_Terminal ' })).toBe(true)
})
it('keeps the normal resize repaint path for modern terminals', () => {
expect(needsAltScreenResizeScrollbackClear({ TERM_PROGRAM: 'vscode' })).toBe(false)
expect(needsAltScreenResizeScrollbackClear({ TERM_PROGRAM: 'iTerm.app' })).toBe(false)
})
})