Finder-launched terminals now inherit a login PATH so tools like ollama resolve, destructive SFTP/editor actions require confirmation, and terminal search plus window dragging work again. SSH forwards and RDP sessions keep listeners and survive reconnect without FastPath crashes. Co-authored-by: Cursor <cursoragent@cursor.com>
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { beforeEach, describe, expect, it } from 'vitest'
|
|
|
|
import { useTabStore } from '../../src/stores/tabStore'
|
|
import { rewriteTabConnectionIds } from '../../src/stores/connection/rewriteTabs'
|
|
|
|
describe('rewriteTabConnectionIds', () => {
|
|
beforeEach(() => {
|
|
useTabStore.setState({ tabs: [], activeTabId: null })
|
|
})
|
|
|
|
it('remaps connectionInstance ids across tabs', () => {
|
|
useTabStore.setState({
|
|
tabs: [
|
|
{
|
|
id: 't1',
|
|
title: 'a',
|
|
type: 'terminal',
|
|
connectionInstance: { connectionId: 'old', shellId: 's1' },
|
|
} as never,
|
|
{
|
|
id: 't2',
|
|
title: 'b',
|
|
type: 'sftp',
|
|
connectionInstance: { connectionId: 'old', sftpId: 'f1' },
|
|
} as never,
|
|
{
|
|
id: 't3',
|
|
title: 'c',
|
|
type: 'terminal',
|
|
connectionInstance: { connectionId: 'other', shellId: 's2' },
|
|
} as never,
|
|
],
|
|
activeTabId: 't1',
|
|
})
|
|
|
|
rewriteTabConnectionIds('old', 'new')
|
|
|
|
const tabs = useTabStore.getState().tabs
|
|
expect(tabs[0].connectionInstance?.connectionId).toBe('new')
|
|
expect(tabs[1].connectionInstance?.connectionId).toBe('new')
|
|
expect(tabs[2].connectionInstance?.connectionId).toBe('other')
|
|
})
|
|
})
|