positron icon indicating copy to clipboard operation
positron copied to clipboard

Remote SSH: Show configured hosts, or remember previous connections

Open jmcphers opened this issue 1 year ago • 1 comments

System details:

Positron and OS details:

Positron Version: 2024.09.0 (Universal) build 81
Code - OSS Version: 1.93.0
Commit: 9d1d5183c5c1dfc985526a6840290bee14617f9d
Date: 2024-09-24T02:44:03.475Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0

Describe the issue:

Positron doesn't remember the names of hosts you previously connected to, nor does it read your SSH configuration to offer pre-defined hosts.

You have to type the name of the host every time you want to connect.

Steps to reproduce the issue:

Add an SSH host to your ~/.ssh/config, and/or connect repeatedly to the same host. Each time you are prompted for the username/hostname.

image

Expected or desired behavior:

We should read the ~/.ssh/config file and show any hosts you've defined in there as shortcuts (it's sort of surprising that this doesn't already happen since Remote-SSH has a dedicated command to open this file). We could also optionally remember previous hosts you've connected to so you don't need to type their names every time.

Here's what VS Code's remote SSH connection menu looks like with my ~/.ssh/config; it correctly reads all of the hosts from the file and offers them as destinations.

image

jmcphers avatar Sep 24 '24 17:09 jmcphers

I just noticed that the remote SSH extension does do this, it just puts it on the sidebar:

Image

jmcphers avatar Oct 10 '24 21:10 jmcphers

Can we also expose this in the Quick Pick?

jthomasmock avatar Oct 06 '25 19:10 jthomasmock

@austin3dickey Thank you for making these very robust changes to the remote SSH experience!

I'm trying some different test scenarios and I might have experienced a couple issues. Let's get together to chat about the issues to make sure that these changes yield expected behaviors and no new issues.


Verified Fixed

Positron Version(s) : 2025.11.0 build 88
OS Version          : macOS Tahoe 26.0.1

Test scenario(s)

Configured hosts appear

  • ~/.ssh/config hosts show in quickpick
  • Aliases are correct, and no typing is needed

Manual connection works

  • Typing user@host connects normally
  • Doesn’t break list display
  • Note: I dislike that the format template disappears (in the field disappears as user is typing, but tooltip is still present, which, upon hovering, can help guide the user if needed).
Image

Add host via UI (POTENTIAL ISSUE 1)

  • “Add new host” works
  • Host appears in list after add
  • Entry saved to config

List updates after file change (POTENTIAL ISSUE 2)

  • New hosts show without restart
  • No duplicates or stale cache

Malformed config handled (POTENTIAL ISSUE 3)

  • Valid hosts show
  • Invalid skipped or marked
  • No crashes

Empty / missing config (POTENTIAL ISSUE 4)

  • Only “Add new host” option
  • Manual entry works
  • Graceful handling

Case-insensitive lookup

  • Host found regardless of case
  • Alias resolves correctly

Multiple hosts

  • All appear in list
  • Typing filters correctly
  • Scrolling works (if needed)

Keyboard navigation

  • Arrows/Tab navigate list
  • Enter connects to selected host

State preserved

  • Configured hosts persist
  • No accidental disappearance

Regression checks

  • Manual SSH still works
  • quickpick refreshes and it's synced with config file (POTENTIAL ISSUE 5)
  • Unicode handled
  • Host key prompts OK

Question

Default shortcut/keybinding for remote SSH?

Note

  • During testing, identified bug #10067.

rodrigosf672 avatar Oct 21 '25 20:10 rodrigosf672

Closing this and @austin3dickey will create a new issue for adding title to quickpick.

rodrigosf672 avatar Oct 24 '25 18:10 rodrigosf672

Aforementioned issue: https://github.com/posit-dev/positron/issues/10138

austin3dickey avatar Oct 24 '25 18:10 austin3dickey