mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
* fix(settings): make WSL skill commands pasteable (#7795) * Fix WSL skill commands so PowerShell 7 pastes match PowerShell 5.1 argv - Encode the WSL login-shell script as base64 and decode/eval it inside the sh -c invocation, avoiding raw nested quotes at the paste boundary - Scope $PSNativeCommandArgumentPassing = 'Legacy' to the invocation so PS 5.1 and PS 7 both hand wsl.exe the same escaped argv - Extract powershell-native-argument.ts as the shared quoting module and reuse it from ssh-remote-powershell.ts * test(runtime): stub getRepo in mobile-tab startup cwd test Main's #7892 made listMobileSessionTabs validate selectors via this.store?.getRepo; the mock store here only defined getWorkspaceSession, so the merged CI build threw 'getRepo is not a function'. Return null (wt-1 is a worktree id, not a repo). Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Co-authored-by: Orca <help@stably.ai>
16 lines
648 B
TypeScript
16 lines
648 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { quotePowerShellLiteral, quotePowerShellNativeArgument } from './powershell-native-argument'
|
|
|
|
describe('PowerShell native argument quoting', () => {
|
|
it('escapes literals for PowerShell source parsing', () => {
|
|
expect(quotePowerShellLiteral("WSL 'Preview'")).toBe("'WSL ''Preview'''")
|
|
})
|
|
|
|
it('pre-escapes embedded quotes for Windows native argv parsing', () => {
|
|
expect(quotePowerShellNativeArgument('eval "decoded"')).toBe(String.raw`'eval \"decoded\"'`)
|
|
expect(quotePowerShellNativeArgument(String.raw`before\"after`)).toBe(
|
|
String.raw`'before\\\"after'`
|
|
)
|
|
})
|
|
})
|