fix: ssh adapter supports any system with /bin/sh (#161)
This allows support of other *nix operating systems where bash is not universally present.
This commit is contained in:
parent
e45aeebc2b
commit
ebcd720a09
3 changed files with 4 additions and 5 deletions
|
|
@ -267,7 +267,7 @@ nvim oil-ssh://[username@]hostname[:port]/[path]
|
||||||
|
|
||||||
This may look familiar. In fact, this is the same url format that netrw uses.
|
This may look familiar. In fact, this is the same url format that netrw uses.
|
||||||
|
|
||||||
Note that at the moment the ssh adapter does not support Windows machines, and it requires the server to have a `/bin/bash` binary as well as standard unix commands (`rm`, `mv`, `mkdir`, `chmod`, `cp`, `touch`, `ln`, `echo`).
|
Note that at the moment the ssh adapter does not support Windows machines, and it requires the server to have a `/bin/sh` binary as well as standard unix commands (`rm`, `mv`, `mkdir`, `chmod`, `cp`, `touch`, `ln`, `echo`).
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,11 @@ end
|
||||||
function SSHConnection.new(url)
|
function SSHConnection.new(url)
|
||||||
local command = SSHConnection.create_ssh_command(url)
|
local command = SSHConnection.create_ssh_command(url)
|
||||||
vim.list_extend(command, {
|
vim.list_extend(command, {
|
||||||
"/bin/bash",
|
"/bin/sh",
|
||||||
"--norc",
|
|
||||||
"-c",
|
"-c",
|
||||||
-- HACK: For some reason in my testing if I just have "echo READY" it doesn't appear, but if I echo
|
-- HACK: For some reason in my testing if I just have "echo READY" it doesn't appear, but if I echo
|
||||||
-- anything prior to that, it *will* appear. The first line gets swallowed.
|
-- anything prior to that, it *will* appear. The first line gets swallowed.
|
||||||
"echo '_make_newline_'; echo '===READY==='; exec /bin/bash --norc",
|
"echo '_make_newline_'; echo '===READY==='; exec /bin/sh",
|
||||||
})
|
})
|
||||||
local term_bufnr = vim.api.nvim_create_buf(false, true)
|
local term_bufnr = vim.api.nvim_create_buf(false, true)
|
||||||
local self = setmetatable({
|
local self = setmetatable({
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ describe("url", function()
|
||||||
it("get_url_for_path", function()
|
it("get_url_for_path", function()
|
||||||
local cases = {
|
local cases = {
|
||||||
{ "", "oil://" .. util.addslash(vim.fn.getcwd()) },
|
{ "", "oil://" .. util.addslash(vim.fn.getcwd()) },
|
||||||
{ "term://~/oil.nvim//52953:/bin/bash", "oil://" .. vim.loop.os_homedir() .. "/oil.nvim/" },
|
{ "term://~/oil.nvim//52953:/bin/sh", "oil://" .. vim.loop.os_homedir() .. "/oil.nvim/" },
|
||||||
{ "/foo/bar.txt", "oil:///foo/", "bar.txt" },
|
{ "/foo/bar.txt", "oil:///foo/", "bar.txt" },
|
||||||
{ "oil:///foo/bar.txt", "oil:///foo/", "bar.txt" },
|
{ "oil:///foo/bar.txt", "oil:///foo/", "bar.txt" },
|
||||||
{ "oil:///", "oil:///" },
|
{ "oil:///", "oil:///" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue