From 1bc25cf25b9fed99debb5c114a03f32c724de07e Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sun, 8 Jan 2023 23:34:31 -0800 Subject: [PATCH] doc: leave note about ssh adapter limitations --- README.md | 6 +----- lua/oil/adapters/ssh/connection.lua | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c31d963..f4559f5 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ This should look familiar. In fact, if you replace `oil-ssh://` with `sftp://`, While this adapter effectively replaces netrw for directory browsing, it still relies on netrw for file editing. When you open a file from oil, it will use the `scp://host/path/to/file.txt` format that triggers remote editing via netrw. +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`). ## API @@ -209,13 +210,11 @@ Get the entry on a specific line (1-indexed) `get_cursor_entry(): nil|oil.Entry` \ Get the entry currently under the cursor - ### discard_all_changes() `discard_all_changes()` \ Discard all changes made to oil buffers - ### set_columns(cols) `set_columns(cols)` \ @@ -230,7 +229,6 @@ Change the display columns for oil `get_current_dir(): nil|string` \ Get the current directory - ### open_float(dir) `open_float(dir)` \ @@ -254,7 +252,6 @@ Open oil browser for a directory `close()` \ Restore the buffer that was present when oil was opened - ### select(opts) `select(opts)` \ @@ -287,7 +284,6 @@ Initialize oil | ----- | ------------ | ---- | | opts | `nil\|table` | | - ## FAQ diff --git a/lua/oil/adapters/ssh/connection.lua b/lua/oil/adapters/ssh/connection.lua index eac244a..22633e0 100644 --- a/lua/oil/adapters/ssh/connection.lua +++ b/lua/oil/adapters/ssh/connection.lua @@ -57,6 +57,8 @@ function SSHConnection.new(url) "/bin/bash", "--norc", "-c", + -- 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. "echo '_make_newline_'; echo '===READY==='; exec /bin/bash --norc", } local self = setmetatable({