@@ -471,21 +471,11 @@ extension WorkspaceRemoteSessionController {
471471 ] )
472472 }
473473
474- let scpSSHOptions = RemoteSSHConnectionPolicy . backgroundOptions ( configuration. sshOptions)
475- var scpArgs : [ String ] = [ " -q " ]
476- scpArgs += RemoteSSHConnectionPolicy . strictHostKeyCheckingArguments ( unlessSetIn: scpSSHOptions)
477- scpArgs += [ " -o " , " ControlMaster=no " ]
478- if let port = configuration. port {
479- scpArgs += [ " -P " , String ( port) ]
480- }
481- if let identityFile = configuration. identityFile,
482- !identityFile. trimmingCharacters ( in: . whitespacesAndNewlines) . isEmpty {
483- scpArgs += [ " -i " , identityFile]
484- }
485- for option in scpSSHOptions {
486- scpArgs += [ " -o " , option]
487- }
488- scpArgs += [ localBinary. path, " \( configuration. destination) : \( remoteTempPath) " ]
474+ let scpArgs = WorkspaceRemoteSSHBatchCommandBuilder . scpUploadArguments (
475+ configuration: configuration,
476+ localPath: localBinary. path,
477+ remotePath: remoteTempPath
478+ )
489479 let scpResult = try scpExec ( arguments: scpArgs, timeout: 45 )
490480 guard scpResult. status == 0 else {
491481 let detail = Self . bestErrorLine ( stderr: scpResult. stderr, stdout: scpResult. stdout) ?? " scp exited \( scpResult. status) "
@@ -512,7 +502,6 @@ extension WorkspaceRemoteSessionController {
512502 _ fileURLs: [ URL ] ,
513503 operation: TerminalImageTransferOperation
514504 ) throws -> [ String ] {
515- let scpSSHOptions = RemoteSSHConnectionPolicy . backgroundOptions ( configuration. sshOptions)
516505 return try performSCPUploadWithCancelCleanup (
517506 items: fileURLs,
518507 checkCancelled: { try operation. throwIfCancelled ( ) } ,
@@ -524,19 +513,11 @@ extension WorkspaceRemoteSessionController {
524513
525514 let remotePath = Self . remoteDropPath ( for: normalizedLocalURL)
526515 record ( remotePath)
527- var scpArgs : [ String ] = [ " -q " , " -o " , " ControlMaster=no " ]
528- scpArgs += RemoteSSHConnectionPolicy . strictHostKeyCheckingArguments ( unlessSetIn: scpSSHOptions)
529- if let port = configuration. port {
530- scpArgs += [ " -P " , String ( port) ]
531- }
532- if let identityFile = configuration. identityFile,
533- !identityFile. trimmingCharacters ( in: . whitespacesAndNewlines) . isEmpty {
534- scpArgs += [ " -i " , identityFile]
535- }
536- for option in scpSSHOptions {
537- scpArgs += [ " -o " , option]
538- }
539- scpArgs += [ normalizedLocalURL. path, " \( configuration. destination) : \( remotePath) " ]
516+ let scpArgs = WorkspaceRemoteSSHBatchCommandBuilder . scpUploadArguments (
517+ configuration: configuration,
518+ localPath: normalizedLocalURL. path,
519+ remotePath: remotePath
520+ )
540521
541522 let scpResult = try scpExec ( arguments: scpArgs, timeout: 45 , operation: operation)
542523 guard scpResult. status == 0 else {
0 commit comments