Add SSH-authenticated transports with independent settings, protocol-aware menus and snippets, and tmux session persistence. Restore eligible iOS workspaces from encrypted transport checkpoints without adding a macOS recovery entry. Include schema migrations and regression coverage.
25 lines
611 B
Swift
25 lines
611 B
Swift
import TermindApplication
|
|
import TermindDomain
|
|
|
|
import struct TermindDomain.Host
|
|
|
|
nonisolated enum MobileConnectionProtocol: Hashable {
|
|
case ssh
|
|
case sftp
|
|
|
|
var useCase: HostUseCase {
|
|
switch self {
|
|
case .ssh: .preferredTerminal
|
|
case .sftp: .sftp
|
|
}
|
|
}
|
|
|
|
func kind(for host: Host) -> ConnectionHistoryEntry.Kind? {
|
|
guard host.supports(useCase.protocolRequirement) else { return nil }
|
|
switch self {
|
|
case .ssh: return host.preferredTerminalProtocol.map(ConnectionHistoryEntry.Kind.terminal)
|
|
case .sftp: return .sftp
|
|
}
|
|
}
|
|
}
|