mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-15 04:12:25 +00:00
fix(tui): restore clipboard hotkeys in clarify mode
This commit is contained in:
parent
8c9fdedaf5
commit
c3af012a35
4 changed files with 109 additions and 4 deletions
29
ui-tui/src/__tests__/clipboard.test.ts
Normal file
29
ui-tui/src/__tests__/clipboard.test.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { readClipboardText } from '../lib/clipboard.js'
|
||||
|
||||
describe('readClipboardText', () => {
|
||||
it('does nothing off macOS', () => {
|
||||
const run = vi.fn()
|
||||
|
||||
expect(readClipboardText('linux', run)).toBeNull()
|
||||
expect(run).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('reads text from pbpaste on macOS', () => {
|
||||
const run = vi.fn().mockReturnValue({ status: 0, stdout: 'hello world\n' })
|
||||
|
||||
expect(readClipboardText('darwin', run)).toBe('hello world\n')
|
||||
expect(run).toHaveBeenCalledWith(
|
||||
'pbpaste',
|
||||
[],
|
||||
expect.objectContaining({ encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] })
|
||||
)
|
||||
})
|
||||
|
||||
it('returns null when pbpaste fails', () => {
|
||||
const run = vi.fn().mockReturnValue({ status: 1, stdout: '' })
|
||||
|
||||
expect(readClipboardText('darwin', run)).toBeNull()
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue