GithubHelp home page GithubHelp logo

amitds1997 / remote-nvim.nvim Goto Github PK

View Code? Open in Web Editor NEW
585.0 7.0 12.0 467 KB

Remote development in Neovim 🔥

License: MIT License

Lua 95.30% Shell 4.48% Makefile 0.22%
neovim neovim-plugin nvim nvim-plugin dev-containers devcontainers docker remote-development ssh

remote-nvim.nvim's People

Contributors

amitds1997 avatar edmondop avatar github-actions[bot] avatar jiz4oh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

remote-nvim.nvim's Issues

Yank/Paste Register Integrated with Clipboard

While using this plugin, it would be really nice to be able to copy and paste from the remote nvim session to the host machine's clipboard and vice versa. This works will a normal nvim session, but as soon as I open a remote session I am unable to use the clipboard.

SSH config parser fails when `Include`-ing wildcards

Describe the bug

SSH config Include keyword supports supplying glob wildcard patterns[1]. When doing so, remote-nvim's SSH config parser tries to access a file with the pattern as the name.

1: From ssh_config(5) manual page:

Include
               Include the specified configuration file(s).  Multiple
               pathnames may be specified and each pathname may contain
               glob(7) wildcards and, for user configurations, shell-
               like ‘~’ references to user home directories.  Wildcards
               will be expanded and processed in lexical order.  Files
               without absolute paths are assumed to be in ~/.ssh if
               included in a user configuration file or /etc/ssh if
               included from the system configuration file.  Include
               directive may appear inside a Match or Host block to
               perform conditional inclusion.

To reproduce

# ~/.ssh/config
Include config.d/*

Resuls in the error:

E5108: Error executing lua: ...mote/lua/remote-nvim/providers/ssh/ssh_config_parser.lua:121: bad argument #1 to 'lines' (config.d/*: No such file or directory)

Expected behavior

remote-nvim should include configuration files using the algorithm described in the manual page.

Get remote OS failed: command not found

Describe the bug
I installed the plugin and executed RemoteStart with [email protected] in the ssh prompt

ERROR Wed 01 Nov 2023 10:12:39 PM +07 .local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
zsh:1: command not found: [email protected]

To Reproduce
Steps to reproduce the behavior:

  1. Run 'RemoteStart'
  2. Select 'Connect to host using connection string'
  3. Prompt '[email protected]'
  4. See log from 'RemoteLog'

Expected behavior
Connect successfully

System Info

  • Your local OS: Arch Linux
  • Local Neovim version: v0.10.0-dev-1031+gc431d820e
  • Remote host OS (if applicable): Arch Linux
  • Remote Neovim version (if applicable): v0.10.0-dev-1031+gc431d820e

Replace scp with rsync if available

Copying the local configuration to the remote can be extremely slow. scp always reuploads everything whereas rsync could only upload files that are missing or changed.

Encountered error E5560 when trying to connect to devcontainer workspace

Describe the bug

I tried to launch a devcontainer of https://github.com/moby/moby project and attach to it, but failed with error

Error executing luv callback:
vim/_editor.lua:0: E5560: nvim_err_writeln must not be called in a lua loop callback
stack traceback:
        [C]: in function 'nvim_err_writeln'
        vim/_editor.lua: in function 'notify'
        .../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:802: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:801>

To reproduce

Use the repro.lua to
reproduce the issue.

  1. Open moby dir with nvim
  2. :RemoteStart
  3. Select Dev Containers: Launch current project in devcontainer
  4. Follow steps and choose Launch local Neovim client?
  5. Get the error

Expected behavior

Connect to my devcontainer.

Screenshot/Screencast(s)

image

System information

  • Your local OS: MacOS Sonoma 14.0

  • Local Neovim version: NVIM v0.10.0
    Build type: Release
    LuaJIT 2.1.1713484068

  • Remote host OS (if applicable): Linux db7593b9ebcf 6.9.6-orbstack-00147-gb0567c7c0069 #1 SMP Sun Jun 23 23:24:08 UTC 2024 aarch64 GNU/Linux

  • Remote Neovim version (if applicable): 10.0, installed via remote-nvim,

Additional context

No

Show running logs for Remote Start

Show active running logs when :RemoteStart is executed and the plugin is trying to connect to a remote machine. This provides active feedback on what is happening.

vimL function must not be called in a lua loop callback

I'm new to Neovim and Lazy.vim as well. I just installed the plugin and try to run it and was met with this error.

.local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:418: /usr/share/nvim/runtime/lua/vim/ui.lua:50: E5560: vimL function must not be called in a lua loop callback

To Reproduce
Steps to reproduce the behavior:

  1. :Lazy load remote-nvim.nvim
  2. :RemoteStart
  3. Select from ssh config file
  4. See error

Expected behavior
Expected to connect to server

System Info

  • Your local OS: Ubuntu 23.04
  • Local Neovim version: 0.9.2
  • Remote host OS (if applicable): Rocky Linux
  • Remote Neovim version (if applicable): None. Do I need it installed on the server?

Any support for Kubernetes pods

Discussed in #106

Originally posted by sinkr April 17, 2024
I don't feel like kubectl exec is too far different from docker exec, but I may not be understanding how the plugin will work.

Thanks.

Investigate devpod vs devcontainer for backing executable for devcontainer

Feature Devcontainer CLI Devpod CLI
Set up a devcontainer ✅ (using devcontainer up) ✅ (using devpod up)
Set up a running container ✅ (using devcontainer set-up) ✅ (using devpod up)
Stop a running dev container ✅ (using devpod stop)
Port forwarding ⚠️ (Can be implemented with a lot of effort) ✅ (using devpod ssh)
Running manual commands inside the devcontainer ✅ (using devcontainer exec) ✅ (using devpod ssh)
Deleting dev container ✅ (using devpod down)

Permissions denied opening user config file

After RemoteStart > Dev Containers: Launch current project in devcontainer and the Docker image is pulled and built, Testing remote connection fails with:

Can't open user config file /home/user/.local/share/nvim/remote-nvim.nvim/ssh_config: Permission denied

but I can open this file fine with Neovim. All work is done locally.

  • Your local OS: Arch Linux
  • Local Neovim version: v0.10.0

Log:

ERROR Mon 27 May 2024 00:30:36 PM EDT /home/user/.local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:972: 'Testing remote connection' failed.
stack traceback:
  .../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:973: in function '_handle_job_completion'
  .../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:1016: in function 'run_command'
  .../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:142: in function '_setup_workspace_variables'
  ...vim/lua/remote-nvim/providers/devpod/devpod_provider.lua:88: in function '_setup_workspace_variables'
  .../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:871: in function '_launch_neovim'
  ...vim/lua/remote-nvim/providers/devpod/devpod_provider.lua:189: in function <...vim/lua/remote-nvim/providers/devpod/devpod_provider.lua:177>
  [C]: in function 'xpcall'
  .../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:758: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:757> 

FAILED JOB OUTPUT (SO FAR)
Can't open user config file /home/user/.local/share/nvim/remote-nvim.nvim/ssh_config: Permission denied

Additional context

I could easily be mis-configuring something, new to containers and not really a programmer. I just navigate to a repo with a .devcontainer/ and start the project for the first time.

Support explicitly specifying nvim version

Some remote machines have only old version GLIBC, which doesn't support nvim-0.10.0. I got the following error when deploying to a remote machine which has GLIBC version 0f 2.17.

Searching for free port on the remote machine
    Command: /home/users/yufeng.xia/.remote-nvim/nvim-downloads/v0.10.0/bin/nvim -l /home/users/yufeng.xia/.remote-nvim/scripts/free_port_finder.lua

    /home/users/yufeng.xia/.remote-nvim/nvim-downloads/v0.10.0/bin/nvim: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /home/users/yufeng.xia/.remote-nvim/nvim-downloads/v0.10.0/bin/nvim)
    /home/users/yufeng.xia/.remote-nvim/nvim-downloads/v0.10.0/bin/nvim: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/users/yufeng.xia/.remote-nvim/nvim-downloads/v0.10.0/bin/nvim)

Would it be possible to specify the to-be-installed nvim version on remote machine in the pop-up session? Thanks~

Non-standard config path in local

Is your feature request related to a problem? Please describe.
Having a non-standard config path in local machine prevents loading the config on remote. For example, if the path to the config is ~/.config/weird_nvim/, then after copying the config over, there will be two directories on remote:

  • ~/.remote-nvim/workspaces/[workspace_tag]/.config/weird_nvim/, this is the copied config folder from local, and
  • ~/.remote-nvim/workspaces/[workspace_tag]/.config/nvim/, this is the empty default config folder. Remote-nvim will load from this instead of the other folder.

Describe the solution you'd like
Specifying with remote config folder to load. This is similar to NVIM_APPNAME. For example,

copy_dirs = {
  config = {
    base = vim.fn.stdpath("config"),
    dirs = "*",
    nvim_appname = "weird_nvim",
  }
}

ssh config parser fails when including global options

If the .ssh/config file includes global options like the following:

AddKeysToAgent yes
IdentitiesOnly yes

Host <examplehost1>
  HostName <examplehostname1>
  Port 22
  User <exampleuser>

...

the ssh_config_parser.lua invoked by the RemoteStart command fails with the following output:

E5108: Error executing lua: ...nvim/lua/remote-nvim/providers/ssh/ssh_config_parser.lua:51: attempt to index a nil value
stack traceback:
        ...nvim/lua/remote-nvim/providers/ssh/ssh_config_parser.lua:51: in function 'parse_config_file'
        ...nvim/lua/remote-nvim/providers/ssh/ssh_config_parser.lua:67: in function 'parse_ssh_configs'
        ...vim/lua/telescope/_extensions/choices/ssh/known_host.lua:28: in function 'action'
        ...mote-nvim.nvim/lua/telescope/_extensions/remote-nvim.lua:53: in function 'run_replace_or_original'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:253: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mapping
s.lua:252>

Fix: Deleting the global options, fixes the error. I assume the parser does not handle the global options correctly.

System info

  • Your local OS: Linux
  • Local Neovim version: v0.9.5

Feature request dashboard

This issue tracks pending feature requests yet to be implemented in the plugin. Creating this single issue to keep track of all pending feature requests and for a comprehensive view on what features do plugin users find helpful. Use this issue for discussion or create a discussion for longer discussion. If a feature seems useful, it will be updated in this description box.

Process to request a feature

  1. Start a discussion / Open an issue describing what you need.
  2. After our discussion, if the request seems useful, we'll add it to this dashboard.

Pending features

SCP'ing Config To Remote Fails

It appears that I am unable to copy my nvim config to the remote host, and I cannot figure out why this is happening. I have tried completely deleting my whole setup including cache and reinstalling.

image

Add support for Passphrases on protected private keys.

Is your feature request related to a problem? Please describe.
Yes. Right now whenever I try to ssh into any host using a protected private key from my local machine, remote-nvim.nvim doesn't let me input the passphrase.

Describe the solution you'd like
I would love if it let me enter the passphrase like it let's me enter the normal password.

Screenshots:
image

Remote OS Support: FreeBSD

Is your feature request related to a problem? Please describe.
As a developer, I would like remote-nvim.nvim to support FreeBSD as a remote operating system, so that I can edit files (and develop plugins) on my OPNSense firewall.

Describe the solution you'd like
Add support for the FreeBSD operating system as a remote endpoint.

Describe alternatives you've considered
I attempted selecting Linux and macOS when connecting. Both failed.

Additional context
Log Output

ERROR Fri Jan 12 09:32:30 2024 /Users/<snip>/.local/Cellar/neovim/HEAD-677e02b/share/nvim/plugged/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Install Neovim if not exists' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:372: in function '_setup_remote'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:544: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
Unsupported operating system: FreeBSD

Nothing happened after "Start local client"

Describe the bug
Run 'RemoteStart' and everything works well, but after Start Local Client, A float window and show up and disappear, then nothing changed.

I can run 'RemoteSessionInfo' to check the remote servers info, it looks well, but I can't connect it using :RemoteStart

To Reproduce
Steps to reproduce the behavior:

  1. Go to RemoteStart
  2. Choose yes in Start Local Client
  3. An empty windows shows up and disappear
  4. Nothing changed

Expected behavior
After I chose Start Local Client, I should connect the remote nvim.

System Info

  • Your local OS: Mac OS X 13.4.1
  • Local Neovim version: neovim 0.9.0
  • Remote host OS (if applicable): Debian 11
  • Remote Neovim version (if applicable): neovim 0.10.0

Additional context
Should I open the firewall port? But afaik, the port is dynamic in different sessions.

lazy plugin installed, but not loaded; how to use it?

Describe the bug

I have installed the plugin with lazy following the instructions in the README and it shows as installed. However if I do :RemoteStart, it is not available.

Expected behavior

I was expecting to work when I write the command :RemoteStart.

Screenshots

image

image

image

System info

  • Your local OS: Slackware Linux
  • Local Neovim version: 0.9.0
  • Remote host OS (if applicable):
  • Remote Neovim version (if applicable):

Additional context

Did I miss anything in the configuration? I have only copied this:

{
"amitds1997/remote-nvim.nvim",
version = "v0.2.2", -- Pin to GitHub releases
dependencies = {
"nvim-lua/plenary.nvim", -- For standard functions
"MunifTanjim/nui.nvim", -- To build the plugin UI
"nvim-telescope/telescope.nvim", -- For picking b/w different remote methods
},
config = true,
}

and added to the file lua/custom/plugins.lua where there are all my other plugins (see screenshot).

Errors in stderr messes up 'echo $HOME' command's result

Describe the bug

At first, thank you for your great plugin that makes remote development easier and with more fun!

But something frustrates me that recently I have ssh-ed into a remote server from a VPS vendor with remote-nvim, unluckily remote-nvim failed to create neovim directories. After reading the log, I found the reason is that home directory is not identified correctly. Although the echo command itself is executed without errors, a warning message from bash is emitted into stderr, and remote-nvim takes all of them as the 'home directory'. The full output is like

/home/myuser
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

Please also take a look at the screenshot below.

To reproduce

It's easy to reproduce by echoing some warning message to stderr, in your remote .bashrc.

Expected behavior

With some investigation, I have found the following line contributes to this issue. I'm not sure if the option pty = true is required, but mixing the output of stdout and stderr and using it as command's return value in my opinion is somewhat fragile, which is roughly equivalent to assuming that stderr will always be empty as long as the exit code is 0.

https://github.com/amitds1997/remote-nvim.nvim/blob/main/lua/remote-nvim/providers/executor.lua#L79

Screenshot/Screencast(s)

image

System information

  • Your local OS: macOS 14.5
  • Local Neovim version: v0.10.1
  • Remote host OS (if applicable): Ubuntu
  • Remote Neovim version (if applicable): non

Get stuck on the "Find free port on remote running" msg

Describe the bug
"Find free port on remote running"

To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin
  2. Setup a docker container at port 35222 (ssh)
  3. Try to connect to the remote server
  4. Get stuck on the "Find free port on remote running" msg

Expected behavior
Go forward in the setup process

Screenshots
image

System Info

  • Your local OS: Ubuntu
  • Local Neovim version: v0.8.3
  • Remote host OS (if applicable): Ubuntu
  • Remote Neovim version (if applicable): v0.8.3

Remote Connection ARM Support

When trying to connect to a remote machine like a raspberry pi, neovim app image installation fails due to it being an ARM platform

Cannot install nvim appimage "required file not found"

Describe the bug

I tried running a docker image as a devcontainer using mcr.microsoft.com/devcontainers/python (but it does the same with other devcontainers images), after selecting the neovim version v0.10.0 I get the following error: /home/vscode/.remote-nvim/scripts/neovim_install.sh: line 97: /tmp/tmp.c85bjHajYI/nvim-v0.10.0-linux.appimage: cannot execute: required file not found

To reproduce

Steps to reproduce the behavior:

  1. open nvim
  2. execute RemoteStart
  3. choose Remote Docker: Launch docker image
  4. input mcr.microsoft.com/devcontainers/python
  5. Choose neovim v0.10.0

Expected behavior

A clear and concise description of what you expected to happen.

Screenshot/Screencast(s)

remote-nvim-issue-opti

System information

  • Your local OS: Manjaro Linux x86_64
  • Local Neovim version: v0.10.0
  • Remote host OS (if applicable): mcr.microsoft.com/devcontainers/python
  • Remote Neovim version (if applicable): v0.10.0

Additional context

Logs:

FAILED JOB OUTPUT (SO FAR)
Downloading Neovim...
Download completed.
Extracting Neovim binary...
/home/vscode/.remote-nvim/scripts/neovim_install.sh: line 97: /tmp/tmp.c85bjHajYI/nvim-v0.10.0-linux.appimage: cannot execute: required file not found
ERROR mer. 10 juil. 2024 13:52:29 .local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:973: 'Installing Neovim (if required)' failed.
stack traceback:
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:974: in function '_handle_job_completion'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:1017: in function 'run_command'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:645: in function '_setup_remote'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:873: in function '_launch_neovim'
...vim/lua/remote-nvim/providers/devpod/devpod_provider.lua:189: in function <...vim/lua/remote-nvim/providers/devpod/devpod_provider.lua:177>
[C]: in function 'xpcall'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:759: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:758>

Can't attach to existing devpod workspace to neovim `nvim-v0.10.0-linux.appimage: No such file or directory`

Describe the bug

The plugin is struggling to find the linux appimage when following the same process shown in the project demo for attaching to an existing devpod workspace.

To reproduce

Steps to reproduce the behavior:

  1. Start the demo workspace with devpod: devpod up github.com/microsoft/vscode-remote-try-node --ide None
  2. Select the existing devpod workspace vscode-remote-try-node with RemoteStart command
  3. Everything works as expected until it gets to Extracting Neovim binary...
  4. See error
  Launch Neovim (Run no. 1) (no longer active)
   Setting up devcontainer workspace
    Command: devpod up --open-ide=false --configure-ssh=true --ide=none --ssh-config=/home/bebr/.local/share/nvim/remote-nvim.nvim/ssh_config --log-output=raw vscode-remote-try-node --id vscode-remote-try-node

    Workspace vscode-remote-try-node already exists
    Creating devcontainer...
    Setup container...
    Run 'ssh vscode-remote-try-node.devpod' to ssh into the devcontainer
   Testing remote connection
    Command: echo 'Hello'

    Hello
   Determining OS on remote machine
    Command: uname -s -m

    Linux x86_64
   Checking if Neovim is installed system-wide on remote
    Command: nvim --version || true

    bash: line 1: nvim: command not found
   Choice: Choose Neovim version to install
    Choice selected: v0.10.0
   Determining remote user's home directory
    Command: echo $HOME

    /home/node
   Creating custom neovim directories on remote
    Command: mkdir -p /home/node/.remote-nvim/scripts && mkdir -p /home/node/.remote-nvim/workspaces/jeB0nKDQSw/.config/nvim && mkdir -p /home/node/.remote-nvim/workspaces/jeB0nKDQSw/.cache/nvim && mkdir -p /home/node/.remote-nvim/workspaces/jeB0nKDQSw/.local/state/nvim && mkdir -p /home/node/.remote-nvim/workspaces/jeB0nKDQSw/.local/share/nvim && mkdir -p /home/node/.remote-nvim/nvim-downloads/v0.10.0

   Copying plugin scripts onto remote
    Command: COPY /home/bebr/.local/share/nvim/lazy/remote-nvim.nvim/scripts -> /home/node/.remote-nvim

    free_port_finder.lua                            0%    0     0.0KB/s   --:-- ETA
    free_port_finder.lua                          100%  216   995.4KB/s   00:00    
    neovim_download.sh                              0%    0     0.0KB/s   --:-- ETA
    neovim_download.sh                            100% 4175    13.7MB/s   00:00    
    neovim_install.sh                               0%    0     0.0KB/s   --:-- ETA
    neovim_install.sh                             100% 7088    25.9MB/s   00:00    
   Installing Neovim (if required)
    Command: chmod +x /home/node/.remote-nvim/scripts/neovim_download.sh && chmod +x /home/node/.remote-nvim/scripts/neovim_install.sh && /home/node/.remote-nvim/scripts/neovim_install.sh -v v0.10.0 -d /home/node/.remote-nvim -m binary -a x86_64

    Downloading Neovim...
    Download completed.
    Extracting Neovim binary...
    /home/node/.remote-nvim/scripts/neovim_install.sh: line 97: /tmp/tmp.Hu3vgUFWDo/nvim-v0.10.0-linux.appimage: No such file or directory

Expected behavior

Just like the demos show, the plugin should successfully attach to

Screenshots

If applicable, add screenshots to help explain your problem.

System info

  • Your local OS: EndeavourOS - Arch distro
  • Local Neovim version: 0.10.0
  • Remote host OS (if applicable): vscode-remote-try-node.devpod
  • Remote Neovim version (if applicable): 0.10.0

Additional context

Add any other context about the problem here.

Healthcheck passes for the plugin:

==============================================================================
remote-nvim: require("remote-nvim.health").check()

remote-nvim.nvim ~
- OK curl: `curl 8.7.1 (x86_64-pc-linux-gnu) libcurl/8.7.1 OpenSSL/3.3.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.62.1 nghttp3/1.3.0`
- OK tar: `tar (GNU tar) 1.35`
- OK ssh: `OpenSSH_9.7p1, OpenSSL 3.3.0 9 Apr 2024`
- OK devpod: `v0.5.7`
- OK docker: `Docker version 26.1.3, build b72abbb6f0`

and I can successfully vs code to the same instance if I run with vscode ide.

Neovim installed from arch extra sources:

❯ nvim -V1 -v
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info


1 extra/neovim 0.10.0-2 (6.9 MiB 28.5 MiB) (Installed)
    Fork of Vim aiming to improve user experience, plugins, and GUIs

Nix breaks remote installation scripts

Describe the bug

When trying to launch a devcontainer using devpod on local docker provider under NixOS, everything works great until it tries to run:

Command: chmod +x /home/vscode/.remote-nvim/scripts/neovim_download.sh && chmod +x /home/vscode/.remote-nvim/scripts/neovim_utils.sh && chmod +x /home/vscode/.remote-nvim/scripts/neovim_install.sh && /home/vscode/.remote-nvim/scripts/neovim_install.sh -v v0.10.0 -d /home/vscode/.remote-nvim -m binary -a x86_64

At this point it fails with

bash: line 1: /home/vscode/.remote-nvim/scripts/neovim_install.sh: cannot execute: required file not found

From what I can guess, since my devcontainer doesn't have nix or NixOS installed, but is an unbuntu container, the script is getting incorrectly mangled or something. The first line of the script comes out to be:

#!/nix/store/agkxax48k35wdmkhmmija2i2sxg8i7ny-bash-5.2p26/bin/bash

To reproduce

Steps to reproduce the behavior:

  1. Install plugin on nixos using flake inputs using something like this repo: https://github.com/damccull/kickstart-nix.nvim/
    a. The plugin is imported from github directly in flake.nix, built into a nix vim plugin in neovim-overlay.nix, and instantiated under nvim/plugin/remote-nvim.lua
  2. Try to connect to a dev container.
  3. Watch it fail.

Expected behavior

Should install nvim on remote and connect to it.

Screenshots

System info

  • Your local OS: NixOS
  • Local Neovim version: 10.0
  • Remote host OS (if applicable): Ubuntu container on docker
  • Remote Neovim version (if applicable): 10.0 chosen on the prompt

Additional context

I think maybe the nix vim plugin maker might be mangling the script, expecting to make it work on a nix install rather than anything else.

Job failure when testing connection to remote

I came across the above problem while trying to debug my main machine which fails on the echo 'Hello' check with the following output:

DEBUG Wed 10 Jul 2024 13:19:24 BST /nix/store/8qvna5qxr8yil5l53lchi9db9r7frfb7-vim-pack-dir/pack/myNeovimPackages/start/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:866: [ssh][ubuntu-container] Starting remote neovim launch
DEBUG Wed 10 Jul 2024 13:19:24 BST /nix/store/8qvna5qxr8yil5l53lchi9db9r7frfb7-vim-pack-dir/pack/myNeovimPackages/start/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:141: Did not find any existing configuration. Creating one now..
DEBUG Wed 10 Jul 2024 13:19:24 BST /nix/store/8qvna5qxr8yil5l53lchi9db9r7frfb7-vim-pack-dir/pack/myNeovimPackages/start/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:995: ["ssh"]["ubuntu-container"] Running "echo 'Hello'"
DEBUG Wed 10 Jul 2024 13:19:25 BST /nix/store/8qvna5qxr8yil5l53lchi9db9r7frfb7-vim-pack-dir/pack/myNeovimPackages/start/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:1015: ["ssh"]["ubuntu-container"] Running "echo 'Hello'" completed
ERROR Wed 10 Jul 2024 13:19:25 BST /nix/store/8qvna5qxr8yil5l53lchi9db9r7frfb7-vim-pack-dir/pack/myNeovimPackages/start/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:973: 'Testing remote connection' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:974: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:1017: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:142: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:872: in function '_launch_neovim'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:883: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:882>
	[C]: in function 'xpcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:759: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:758> 

FAILED JOB OUTPUT (SO FAR)
bash: -c: line 1: unexpected EOF while looking for matching `''
bash: -c: line 2: syntax error: unexpected end of file

Which uses OpenSSH_9.8, but since I am going from a NixOS machine to a docker container, there are more than a few moving parts to investigate along the lines of #150 before I feel comfortable opening a new issue. If you have any ideas what might be causing this please let me know!

Originally posted by @TakodaS in #147 (comment)

Choose specific port for connection

Is your feature request related to a problem? Please describe.
I am trying to use this plugin for connecting to a computing cluster which does not have the latest software. Specifically, is has GLIBC version 2.17, which makes the install crash when trying to execute "free_port_finder.lua" with the following error (replaced specific user directory with dots for privacy reasons):

Command: .../.remote-nvim/nvim-downloads/v0.10.0/bin/nvim -l .../.remote-nvim/scripts/free_port_finder.lua

.../.remote-nvim/nvim-downloads/v0.10.0/bin/nvim: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by .../.remote-nvim/nvim-downloads/v0.10.0/bin/nvim)
.../.remote-nvim/nvim-downloads/v0.10.0/bin/nvim: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by .../.remote-nvim/nvim-downloads/v0.10.0/bin/nvim)

Also, for security reasons most ports are blocked on the cluster. I can open an SSH tunnel on a specific port, so ideally I would use that one for the remote session.

Describe the solution you'd like
A way to skip this step and just choose a specific port.

Describe alternatives you've considered
I have tried to install a higher version of GLIBC, but this requires (amongst other things) a newer version of make, and without admin rights this is quite the hassle.

Replace nvim-notify by nui.nvim popup

nvim-notify is no longer the right solution to provide status updates. With integration of devcontainers and option to build Neovim, some operations might take a lot of time so we cannot provide timely updates using nvim-notify anymore. So, we would build a custom window using nui.nvim instead to get around this.

Get OS Failed (Windows)

From #63

image

Here is the contents of the log (I've replaced some identifiable information with |domain| |username| and |hostname|)

Some additional information: I'm on Windows (powershell) using password auth

ERROR 11/1/2023 12:09:06 PM C:/Users/NoodleBug/AppData/Local/nvim-data/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\SYSTEM32\cmd.exe��[?25h
|username|@|hostname| : The term '|username|@|hostname|' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ |username|@|hostname| uname
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (|username|@|hostname|:String) [], CommandNotFoundExc 
   eption
    + FullyQualifiedErrorId : CommandNotFoundException
ERROR 11/2/2023 11:36:56 AM AppData\Local\nvim-data\lazy\remote-nvim.nvim\lua\remote-nvim\providers\provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe��[?25h
|username|@|hostname| : The term '|username|@|hostname|' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:1
+ |username|@|hostname| uname
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (|username|@|hostname|:String) [], CommandNotFoundExc 
   eption
    + FullyQualifiedErrorId : CommandNotFoundException
ERROR 11/3/2023 11:44:55 AM C:/Users/NoodleBug/AppData/Local/nvim-data/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe��[?25h
uname : The term 'uname' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1
+ uname
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (uname:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
ERROR 11/3/2023 11:45:28 AM C:/Users/NoodleBug/AppData/Local/nvim-data/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:600: 'Get remote OS' failed.
stack traceback:
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:601: in function '_handle_job_completion'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:621: in function 'run_command'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:182: in function '_get_remote_os'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:543: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:541>
	[C]: in function 'pcall'
	.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:439: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:438> 

FAILED JOB OUTPUT (SO FAR)
�[?25l�[2J�[m�[H|domain|/|username|@|hostname|'s password:�[1C�]0;C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe��[?25h
uname : The term 'uname' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1
+ uname
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (uname:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Originally posted by @Noodle-Bug in #63 (comment)

Running installation script, but hanging

This seems like a very cool tool. When I follow the guide (or the video) I end up here:
image

It is just hanging, and does not present the next step. I copied the config from the README, but removed the lines with util since they are not specified anywhere (what is util?).

For the servers I work on I use SSH keys.

Any help troubleshooting this is highly appreciated.

Plugin connect to host but won't copy the .config file to the session dir

Hi, great work on the plugin, but i can't figure out how to connect to my host
I'm using LazyVim distro with the default remote-nvim.nvim settings:

return {
  "amitds1997/remote-nvim.nvim",
  tag = "v0.0.1",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
    "rcarriga/nvim-notify",
    "nvim-telescope/telescope.nvim",
  },
  config = true,
}

But the plugin is stuck on the message: Running installation script... completed
and nothing happens. Looking at ~/.remote-nvim i get:

~$ tree -d .remote-nvim/workspaces/HUza2WYq5Q/
.remote-nvim/workspaces/HUza2WYq5Q/

0 directories

Meaning the session dir is empty.

Checking the RemoteLog I get:

[ERROR Sat Mar 2 20:16:45 2024] ~/.local/share/LazyVim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/ssh/ssh_provider.lua:630: "ssh -p 22 user_name@<host ip addr> 'chmod +x ~/.remote-nvim/scripts/neovim_install.sh && ~/.remote-nvim/scripts/neovim_install.sh -v v0.9.5 -d ~/.remote-nvim'" command failed to execute on remote host "user_name@<host ip addr>"

How to implement local complete installation?

If you show me the path, then I would like to implement such feature! This is the most hardest part for me.

Just like telescope, we have no way to just copy ripgrep from host to remote client as it might not work as a binary… Unless we prepare all the necessary binary for all OS.

Don’t know if python wheel/ nodejs npm stuff can help this out?

Get remote OS failed

Describe the bug
Last push fixed my other issue #52. But now I'm experiencing another one.

ERROR Thu 28 Sep 2023 12:35:19 PM EDT .local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:575: 'Get remote OS' failed.
stack traceback:
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:575: in function '_handle_job_completion'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:593: in function 'run_command'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:172: in function '_get_remote_os'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:106: in function '_setup_workspace_variables'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:519: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:518>
[C]: in function 'pcall'
.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:416: in function <.../remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:415>
ERROR Thu 28 Sep 2023 01:02:56 PM EDT .local/share/nvim/lazy/remote-nvim.nvim/lua/remote-nvim/providers/provider.lua:418: /usr/share/nvim/runtime/lua/vim/ui.lua:50: E5560: vimL function must not be called in a lua loop callback

To Reproduce
Steps to reproduce the behavior:
Same as issue #52

System Info

  • Your local OS: Ubuntu 23.04
  • Local Neovim version: 0.9.2
  • Remote host OS (if applicable): Rocky
  • Remote Neovim version (if applicable): None

Additional context

NeovimSSHProvider:get_user_selection never exits

Describe the bug
During RemoteStart, NeovimSSHProvider:get_user_selection always hit the coroutine.yield() statement and never reach the end of the get_user_selection function.

To Reproduce
I just used my configuration (https://github.com/NilujePerchut/configs/tree/master/nvim) and add the following config:

  {
    "amitds1997/remote-nvim.nvim",
    tag = "v0.0.1",
    dependencies = {
      "nvim-lua/plenary.nvim",
      "MunifTanjim/nui.nvim",
      "rcarriga/nvim-notify",
      "nvim-telescope/telescope.nvim",
    }
  }

and
require("remote-nvim").setup()

Expected behavior
The RemoteStart command does not perform the remote connection

System Info

  • Your local OS: Manjaro
  • Local Neovim version: v0.9.1
  • Remote host OS (if applicable): Manjaro
  • Remote Neovim version (if applicable): v0.9.1

Additional context
If I edit a workspace by hand, the RemoteStart command works flawlessly.

Weird behavior inside GUI (neovide)

Bug description

I tried using the plugin in neovide, and it generally worked, but had some issues.

  1. It seems to open the new client in a window or something, and there's a weird border (which doesn't exist in local / manually attached client). image
  2. After some usage, the local client crashed, and the remote server was still alive. image
  3. Sometimes the original, local client was shown instead of the remote-attached one, without any error message.

To reproduce

Steps to reproduce the behavior:

  1. Open neovide
  2. Use RemoteStart <host>, with a host with the client-auto-connect option turned on.
  3. Interact with the attached client for a bit.
  4. See error.

Expected behavior

  • The attached client should look and feel like local client (no extra border), perhaps with some visual indication that we're attached to a remote host.
  • Handle client crashes gracefully by providing the user options: stop remote, reconnect, etc.

System info

  • Local OS: macOS 14.4.1 (23E224)
  • Local Neovim version: neovide 0.12.2 (20240128.222629), neovim:
    NVIM v0.10.0-dev-3048+gee41153a9-Homebrew
    Build type: Release
    LuaJIT 2.1.1713773202
    
  • Remote host OS: Linux 5.3.0-28-generic #​30~18.04.1-Ubuntu
  • Remote Neovim version: nightly, built from source:
    NVIM v0.10.0-dev
    Build type: Release
    LuaJIT 2.1.1713484068
    

Consolidated UI to provide more configurability before launching a session

Following use cases would be better served through a single UI:

  • Allow GPG forwarding for devpod operations
  • Allow choice for launch of Neovim
  • Allow choosing if configuration should be copied over or not
  • Allow choosing whether the Neovim server launched should be detached from the current instance

checkhealth error

I'm working on MacOS with a new install of Neovim v0.9.1 from Homebrew and using LazyVim. I've added a file under .config/nvim/lua/plugins that is

{
   "amitds1997/remote-nvim.nvim",
   tag = "v0.0.1", -- It is recommended that you keep this pinned to a tag
   -- so that you do not pick up breaking changes
   dependencies = {
       "nvim-lua/plenary.nvim",
       "MunifTanjim/nui.nvim",
       "rcarriga/nvim-notify",
       -- This would be an optional dependency eventually
       "nvim-telescope/telescope.nvim",
   }
}

After this plugin installs and I run :checkhealth I get an error

Screen Shot 2023-08-26 at 8 54 46 PM

I'm not sure where I put a config table when working with LazyVim. How do I go about getting this set up?

Resize RemoteNvim Window

When resizing a terminal window, primarily when making it larger, the inner remote nvim session does not seem to resize with the terminal and stays the same size when connected.

I would like to see the remote nvim resize with the terminal either automatically, or by issuing a : command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.