mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-08 08:11:38 +00:00
fix: preserve Ctrl+J newlines in Ghostty
This commit is contained in:
parent
1386a7e478
commit
cf8862cfa3
5 changed files with 82 additions and 8 deletions
|
|
@ -1,11 +1,27 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { shouldPassThroughToGlobalHandler } from '../components/textInput.js'
|
||||
import { shouldPassThroughToGlobalHandler, shouldPreserveCtrlJNewline } from '../components/textInput.js'
|
||||
import { DEFAULT_VOICE_RECORD_KEY, parseVoiceRecordKey } from '../lib/platform.js'
|
||||
|
||||
const key = (overrides: Record<string, unknown> = {}) =>
|
||||
({ ctrl: false, meta: false, ...overrides }) as any
|
||||
|
||||
describe('shouldPreserveCtrlJNewline', () => {
|
||||
it('preserves Ctrl+J as newline in Ghostty even when tmux masks TERM/TERM_PROGRAM', () => {
|
||||
expect(
|
||||
shouldPreserveCtrlJNewline({
|
||||
GHOSTTY_RESOURCES_DIR: '/usr/share/ghostty',
|
||||
TERM: 'tmux-256color',
|
||||
TERM_PROGRAM: 'tmux'
|
||||
})
|
||||
).toBe(true)
|
||||
})
|
||||
|
||||
it('keeps bare local POSIX LF-compatible prompts submitting on Ctrl+J', () => {
|
||||
expect(shouldPreserveCtrlJNewline({ TERM: 'xterm-256color' })).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('shouldPassThroughToGlobalHandler', () => {
|
||||
it('passes through the configured voice shortcut while composer is focused', () => {
|
||||
expect(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue