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
2 changes: 2 additions & 0 deletions apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ describe('useGatewayBoot remote reconnect loop (real hook, fake socket)', () =>

it('FIX: primary sleep/wake reconnect dials the window backend, not the active secondary profile', async () => {
const desktop = fakeDesktop()

;(window as { hermesDesktop?: unknown }).hermesDesktop = desktop

render(<Harness />)
Expand Down Expand Up @@ -440,6 +441,7 @@ describe('useGatewayBoot remote reconnect loop (real hook, fake socket)', () =>
const primaryReconnectSockets = FakeWebSocket.instances
.slice(socketsBeforeDrop)
.filter(socket => socket.url === primaryConn.wsUrl)

expect(primaryReconnectSockets.length).toBeGreaterThan(0)
expect($connection.get()?.profile).toBe('coder')
expect($connection.get()?.baseUrl).toBe(coderConn.baseUrl)
Expand Down
4 changes: 4 additions & 0 deletions ui-tui/src/__tests__/terminalSetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ describe('configureTerminalKeybindings', () => {

it('migrates legacy \\\r\n bindings to CSI u sequences', async () => {
const mkdir = vi.fn().mockResolvedValue(undefined)

const readFile = vi.fn().mockResolvedValue(
JSON.stringify([
{
Expand All @@ -477,6 +478,7 @@ describe('configureTerminalKeybindings', () => {
}
])
)

const writeFile = vi.fn().mockResolvedValue(undefined)
const copyFile = vi.fn().mockResolvedValue(undefined)

Expand All @@ -491,10 +493,12 @@ describe('configureTerminalKeybindings', () => {
expect(result.message).toContain('migrated 3 legacy bindings to CSI u encoding')
const written = writeFile.mock.calls[0]?.[1] as string
const parsed = JSON.parse(written)

// All three Enter bindings should now use CSI u sequences
const enterBindings = parsed.filter((b: { key: string }) =>
['shift+enter', 'ctrl+enter', 'cmd+enter'].includes(b.key)
)

expect(enterBindings).toHaveLength(3)
expect(enterBindings.find((b: { key: string }) => b.key === 'shift+enter')?.args?.text).toBe('\u001b[13;2u')
expect(enterBindings.find((b: { key: string }) => b.key === 'ctrl+enter')?.args?.text).toBe('\u001b[13;5u')
Expand Down
12 changes: 11 additions & 1 deletion ui-tui/src/__tests__/textInputReturnAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,19 @@ describe('shouldInsertNewlineOnReturn', () => {

it('keeps plain Enter as submit on a plain non-macOS terminal', async () => {
const prev = { ...process.env }
for (const k of ['SSH_CONNECTION', 'SSH_CLIENT', 'SSH_TTY', 'WT_SESSION', 'GHOSTTY_RESOURCES_DIR', 'GHOSTTY_BIN_DIR', 'WSL_DISTRO_NAME']) {

for (const k of [
'SSH_CONNECTION',
'SSH_CLIENT',
'SSH_TTY',
'WT_SESSION',
'GHOSTTY_RESOURCES_DIR',
'GHOSTTY_BIN_DIR',
'WSL_DISTRO_NAME'
]) {
delete process.env[k]
}

process.env.TERM = 'xterm-256color'
process.env.TERM_PROGRAM = ''

Expand Down
Loading