-
Notifications
You must be signed in to change notification settings - Fork 17
[Bug] rsync does not support custom remote ssh port #30
Copy link
Copy link
Open
Description
Describe the bug
when setting a host with a port in deployment.lua
return {
["myremote"] = {
host = "hostname:22250",
username = "foo",
mappings = {
{
["local"] = "/",
["remote"] = "/",
},
},
},
}the host works as expected when operations are run through scp but they don't work using rsync.
The commands (based on rsync) lacking support are:
TransferDownloadorTransferUploadwhen path is a dirTransferDirDiff
How to reproduce
- set
hostwith syntaxhostname:port - run either
TransferDownload,TransferUploadon a dir orTransferDirDiff
Error shown:
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255)
Expected behavior
- diff the directory with the remote one and display the changed files in the quickfix
- sync the files
System
- OS: MacOS 13.5.2
- NVIM v0.11.3
- transfer.nvim commit: af75ad5
Solution
- I'm working on a pull request with a modified
remote_rsync_path()to extract port numbers from host strings rsyncdoesn't supporthostname:portnumbersyntax, but it requires to define the port using extended options, i.e.-e "ssh -p {portnumer}"- to avoid command execution issues with extended options, need to pass a string instead of a list to
vim.fn.jobstrart->vim.fn.jobstart(table.concat(command, " "),{...})
Especially about the last point, do you think that could have some side effects?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels