yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.34k stars 30 forks source link

fvim ssh error when connecting on external host #134

Closed rayman22201 closed 4 years ago

rayman22201 commented 4 years ago

I'm running fvim --ssh user@external.ssh.destination

And I'm getting this unhelpful error and stack trace: (attached a screenshot b/c I can't seem to copy and paste the text from the error dialog) https://imgur.com/Sozdp7h

using FVim version: v0.2.240-g104449f (the latest release)

Windows 10 host.

using ssh to a local Ubuntu VM works great. But when I try this external host, it fails.

Thanks in advance for the help.

yatli commented 4 years ago

Are you using a key or a password? Currently password doesn't work (no prompt to input that)

rayman22201 commented 4 years ago

Sorry. I should have mentioned that. Yes. I'm using an ssh key. No password.

yatli commented 4 years ago

Is this a first-time connection (waiting for ssh thumbprint confirmation)? Or, could you connect to the target host in your shell?


Another possibility: Is nvim on the remote PATH? Check this by ssh remote -c 'nvim --version'

rayman22201 commented 4 years ago

Ah, ok. so this is interesting.

ssh remote -C 'nvim --version' does not find nvim.

But, a regular ssh session to an interactive shell works.

Interesting to note: nvim is in a slightly nonstandard path on the remote. On the remote nvim lives in ~/.local/bin/nvim

It looks like ssh is not setting up my PATH or loading my .bashrc at all when not running in interactive mode 😢

I can confirm this by doing ssh remote -c "echo $PATH"

Other than the unclear error message, this seems like this is a ssh / bash config issue on my part and not an fvim issue 😄

Edit: looking at the man page for bash:

When bash is started non-interactively, to run a shell script, for example, it looks for the variable BASH_ENV in the environment, expands its value if it appears there, and uses the expanded value as the name of a file to read and execute. Bash behaves as if the following command were executed:

    if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi 
but the value of the PATH variable is not used to search for the file name. 

I'm not sure if there is a way to make bash find the correct PATH in non-interactive mode... Feature request lol 😛 Is there a way to tell fvim explicitly where to find nvim on the remote?

yatli commented 4 years ago

--nvim path-to-program

yatli commented 4 years ago

@rayman22201 does it work for you? I'm not sure if --nvim works for remote :p

rayman22201 commented 4 years ago

Oh! I'm sorry. I forgot to respond. It works very well!

yatli commented 4 years ago

no worry, thanks for getting back.

#case closed