mirror of
https://github.com/stablyai/orca.git
synced 2026-09-30 16:02:56 +00:00
Allow the existing "Open in" entries to launch a configured VS Code
launcher against an SSH-backed worktree via Remote-SSH:
code --remote ssh-remote+<authority> <remote-path>
- Split the blanket SSH/runtime block into a capability model: file
managers and non-VS Code launchers stay local-only (disabled with
"Local only" metadata); a recognized VS Code command is enabled and
forwarded with connectionId over a typed object IPC.
- Main process stays authoritative: rejects active/owned runtimes,
resolves the SshTarget from the persisted Store, derives the authority
(config alias, or username@host on port 22, or ssh-alias-required on a
non-default port), validates POSIX/Windows absolute remote paths without
local stat/normalize, and rejects non-VS Code and compound commands
before spawn.
- Authority and remote path are passed as separate argv; getSpawnArgsForWindows
remains the cmd/bat shim boundary and fails closed on metacharacters.
- Same capability rules across the worktree menu, Explorer overflow, and
the source-control entry context menu.
Refs STA-2386
Closes #9999
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { isVsCodeLauncherExecutable, isVsCodeRemoteSshCommand } from './vscode-remote-ssh-launcher'
|
|
|
|
describe('VS Code Remote-SSH launcher capability', () => {
|
|
it.each([
|
|
'code',
|
|
'code-insiders',
|
|
'/usr/local/bin/code',
|
|
'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code',
|
|
'C:\\Program Files\\Microsoft VS Code\\Code.exe',
|
|
'C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe',
|
|
'C:\\Tools\\CODE.CMD',
|
|
'C:\\Tools\\code-insiders.bat'
|
|
])('recognizes a safe configured launcher: %s', (command) => {
|
|
expect(isVsCodeRemoteSshCommand(command)).toBe(true)
|
|
})
|
|
|
|
it.each(['cursor', 'zed', 'code --reuse-window', 'open -a "Visual Studio Code"'])(
|
|
'rejects an unsupported or compound command: %s',
|
|
(command) => {
|
|
expect(isVsCodeRemoteSshCommand(command)).toBe(false)
|
|
}
|
|
)
|
|
|
|
it('recognizes resolved Windows launchers by executable basename', () => {
|
|
expect(isVsCodeLauncherExecutable('C:\\Tools\\Code - Insiders.exe')).toBe(true)
|
|
expect(isVsCodeLauncherExecutable('C:\\Tools\\cursor.exe')).toBe(false)
|
|
})
|
|
})
|