fix(tui): improve macOS paste and shortcut parity

- support Cmd-as-super and readline-style fallback shortcuts on macOS
- add layered clipboard/OSC52 paste handling and immediate image-path attach
- add IDE terminal setup helpers, terminal parity hints, and aligned docs
This commit is contained in:
kshitijk4poor 2026-04-21 14:27:28 +05:30 committed by kshitij
parent 432772dbdf
commit 9556fef5a1
31 changed files with 1303 additions and 100 deletions

View file

@ -0,0 +1,36 @@
import { describe, expect, it } from 'vitest'
import { InputEvent } from './input-event.js'
import { parseMultipleKeypresses } from '../parse-keypress.js'
function parseOne(sequence: string) {
const [keys] = parseMultipleKeypresses({ incomplete: '', mode: 'NORMAL' }, sequence)
expect(keys).toHaveLength(1)
return keys[0]!
}
describe('InputEvent macOS command modifiers', () => {
it('preserves Cmd as super for kitty keyboard CSI-u sequences', () => {
const parsed = parseOne('\u001b[99;9u')
const event = new InputEvent(parsed)
expect(parsed.name).toBe('c')
expect(event.key.meta).toBe(false)
expect(event.key.super).toBe(true)
})
it('preserves Cmd on word-delete and word-navigation sequences', () => {
const backspace = new InputEvent(parseOne('\u001b[127;9u'))
const left = new InputEvent(parseOne('\u001b[1;9D'))
const right = new InputEvent(parseOne('\u001b[1;9C'))
expect(backspace.key.backspace).toBe(true)
expect(backspace.key.super).toBe(true)
expect(left.key.leftArrow).toBe(true)
expect(left.key.super).toBe(true)
expect(right.key.rightArrow).toBe(true)
expect(right.key.super).toBe(true)
})
})