FEAT: Add ability to input `[email protected]` manually when using `:SSHConnect`
:SSHConnect command fails silently after "Connecting to hostname" and ignores user specification for raw hostnames
Issues
- User ignored for raw hostnames:
:SSHConnect user@hostnameuses local username instead of specified user for IPs/hostnames not in~/.ssh/config - Silent failures: No error messages when connections fail, leaving empty mount directories
- No debugging tools: Impossible to troubleshoot connection issues
Expected vs Actual
Expected:
:SSHConnect user@hostauthenticates as specified user- Clear error messages for failures
- Failed connections clean up empty directories
Actual:
:SSHConnect remoteusername@[raw server ip]connects as local userlocalusername:SSHConnect mystandcreates empty~/mnt/mystanddirectory with no feedback- Manual
sshcommands work but plugin fails silently
Reproduction
-
Run
:SSHConnect remoteusername@[raw server ip] -
Connection succeeds but uses wrong user (local username instead of
remoteusername) -
Have host in
~/.ssh/config -
Run
:SSHConnect host -
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
:SSHDebugand:SSHTestcommands
https://github.com/user-attachments/assets/584f0dba-80f6-4234-b518-20c766668bcd
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
:SSHConnectwhen 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
:SSHDebugcommand to toggle). - FEAT: Add a
:SSHTestpreflight 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.
Created issues #10, #11, and #12 in reference to this report.