Files and the tree
The tree
The Heimdall view shows one node per connection with its state: idle, connecting, connected, error (with the message in the tooltip) or disabled. Expand a node and it connects and lists the root path; directories first, then files. Nothing dials on startup or on load.
The node's inline actions are Refresh and Edit Connection…; its context menu adds Connect, Reconnect, Disconnect, Test Connection, Open in Terminal and Forget Saved Password / Passphrase. A refresh on a connection in error reconnects, because that's what people mean by it. Folders have Refresh and Open in Terminal; files have Open in Terminal too, which lands in their directory.
The view title has Add Connection…, Connections… (the editor), Refresh, and under the overflow menu Import Connections from SSH Config… and Open sftp.json.
sftp:// files
Every remote file is sftp://<connection>/<absolute path>. The authority is the connection name and the path is the real path on the server, never relative to the root path, so Copy Path gives something true and the tree's root is only where you start looking.
Heimdall registers a file system provider for the scheme, which is what makes a remote file behave like a local one everywhere: it opens with a click, edits, saves, reverts, shows its dirty dot, and other extensions (linters, formatters, image viewers) read it through the provider without knowing it's remote. Rename, delete and new folder work from anything that uses VS Code's file system API.
Save conflicts
SFTP has no change notifications, so Heimdall can't tell you the moment a file changes on the server. What it does instead is check at save time: it reports the server's modification time on every read, VS Code compares that against the one it opened, and a save onto a file someone else wrote since is refused with VS Code's own notification: Compare opens a diff, Overwrite writes yours anyway. The provider does the same check for writes that reach it by other routes.
Three commands on sftp:// editors cover the same ground from the palette and the editor's title menu:
- Heimdall: Show Diff with Server opens a diff between a fresh read of the server's copy and your editor.
- Heimdall: Overwrite on Server writes your copy and reloads the editor from what it wrote.
- Heimdall: Reload from Server discards your copy for the server's.
Modification times are whole seconds, so a change inside the same second as your read goes unnoticed. That's the protocol's limit.
Open in Terminal
Open in Terminal on a connection, a folder or a file starts an ssh session in VS Code's terminal, using the connection's Host alias or host and port, user, key file, config file, host key policy and known_hosts, and runs cd into the directory before handing over to your login shell. Because it's ssh itself, ProxyJump, the agent and a password prompt all work the way they do from any terminal. The terminal is named after the connection and the folder.