sshfs.nvim icon indicating copy to clipboard operation
sshfs.nvim copied to clipboard

FEAT: Add ability to input `[email protected]` manually when using `:SSHConnect`

Open zeromask1337 opened this issue 11 months ago • 2 comments

:SSHConnect command fails silently after "Connecting to hostname" and ignores user specification for raw hostnames

Issues

  1. User ignored for raw hostnames: :SSHConnect user@hostname uses local username instead of specified user for IPs/hostnames not in ~/.ssh/config
  2. Silent failures: No error messages when connections fail, leaving empty mount directories
  3. No debugging tools: Impossible to troubleshoot connection issues

Expected vs Actual

Expected:

  • :SSHConnect user@host authenticates as specified user
  • Clear error messages for failures
  • Failed connections clean up empty directories

Actual:

  • :SSHConnect remoteusername@[raw server ip] connects as local user localusername
  • :SSHConnect mystand creates empty ~/mnt/mystand directory with no feedback
  • Manual ssh commands work but plugin fails silently

Reproduction

  1. Run :SSHConnect remoteusername@[raw server ip]

  2. Connection succeeds but uses wrong user (local username instead of remoteusername)

  3. Have host in ~/.ssh/config

  4. Run :SSHConnect host

  5. Creates empty ~/mnt/host/ directory, no error shown

Environment

  • Neovim 0.10+
  • macOS/Darwin
  • OpenSSH

Proposed Fixes

  • Fix user handling in authentication for raw hostnames
  • Add persistent error display and debug logging
  • Implement proper cleanup of failed mount directories
  • Add :SSHDebug and :SSHTest commands

https://github.com/user-attachments/assets/584f0dba-80f6-4234-b518-20c766668bcd

zeromask1337 avatar Dec 20 '25 11:12 zeromask1337

This issue mixes a few feature requests with legitimate bug/UX problems, so I’m splitting it for tracking.

Feature request: Add ability to input [email protected] manually when using :SSHConnect

:SSHConnect currently accepts either no argument (selects from ~/.ssh/config) or a Host alias from ~/.ssh/config. It does not parse ad-hoc inputs like [email protected] by design.

Workaround: Add a Host entry to your SSH config and connect via the alias.

I understand the convenience of one-off connections and user specification (i.e, root), so I’m open to adding support for user@host as an optional override, but it’s not currently implemented. Might be a good idea to add this to the keymap approach as well to be able to input custom user.

Bugs / improvements (tracked separately)

  • BUG: Connection/mount failures from :SSHConnect when a host is not found are not surfaced (no stderr/exit code), and the plugin can leave empty mount directories behind.
  • FEAT: Add debug logging (a config flag and a :SSHDebug command to toggle).
  • FEAT: Add a :SSHTest preflight command to show resolved parameters and the exact commands/exit codes for a given host.

For the remainder of this thread, I’ll be treating this as the user@host feature request, and I’ll link the new issues once created.

uhs-robert avatar Dec 21 '25 13:12 uhs-robert

Created issues #10, #11, and #12 in reference to this report.

uhs-robert avatar Dec 21 '25 13:12 uhs-robert