Skip to content

feat(sshx): support portable private key paths - #237

Open
loooinfo wants to merge 2 commits into
TooonyChen:mainfrom
loooinfo:feature/portable-private-key-paths
Open

loooinfo wants to merge 2 commits into
TooonyChen:mainfrom
loooinfo:feature/portable-private-key-paths

Conversation

@loooinfo

@loooinfo loooinfo commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Private key paths now expand home and environment expressions when connecting or choosing a key, while the saved expression stays unchanged. A local private key directory at the bottom of Options › Sync lets each computer use %SSH_KEYS%/host.pem with its own folder. The setting applies to direct and jump connections, remains available with sync off, and stays local along with the key files.

Closes #234

Testing

go test -race ./internal/app ./internal/config ./internal/sshx -run 'Test(LocalKeyDirectory|BrowsePortableKeyPath|AuthUsesPortableKeyPath|ExpandKeyPath|ResolveKeyPathDirectoryVariableCase|SettingsSyncDecided|SyncedSettingsRoundTrip|Settings$|EditorKeyFile|SyncPage)' -count=1
go vet ./...
go tool mygo vet
  • Race tests for path expansion, actual private key authentication, chooser paths, the local directory option, jump-host options, settings persistence and sync exclusion. Regressions cover incremental input with spaces, percent variables such as ProgramFiles(x86) and Windows case-insensitive SSH_KEYS overrides (Unix remains case-sensitive).
  • Headless English and Simplified Chinese options tests cover sync on and off, directory input and the folder picker; screenshots are in docs/screenshots/local-key-directory-*.png.
  • Go vet, MyGo vet and diff checks pass. Windows key expansion and authentication tests pass under Wine; the combined custom app cross-builds for Windows amd64, and its %SSH_KEYS% connection path was confirmed working by the user on Windows 11.
  • All four feature branches were combined in a scratch worktree; focused race tests pass and production Go sources match the combined custom app. Later merges need shared documentation/locales resolved and regenerated against the updated main.
  • Complete combined regression: other packages pass. The app package completes with go test -race -timeout 20m ./internal/app in 610 seconds after the default 600-second package limit was reached. Only three failures remain, reproduced on unchanged base 78c2f91: TestBackgroundImage, TestBackgroundReadsOffUIThread and TestCommandBarPage. All added tests pass; no race reports were found. Native Windows/macOS UI tests were not run here.
Options screenshots (English and Simplified Chinese)

English Sync options

Simplified Chinese Sync options

Prepared with Codex.

Keep directory input spaces across editing frames. Accept Windows percent-variable names with parentheses and apply the configured SSH_KEYS override case-insensitively on Windows, retaining case-sensitive Unix semantics. Add regressions for all three confirmed audit findings.

Prepared with Codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sshx): support portable private key paths

1 participant