posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.59k stars 79 forks source link

Remote SSH: Show configured hosts, or remember previous connections #4799

Open jmcphers opened 1 month ago

jmcphers commented 1 month ago

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 commented 2 weeks ago

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

Image