For people with large codebases, programming on a laptop can be overwhelming. Your fans are constantly spinning, the language server is continually ou

SSH Remoting is Here!

submited by
Style Pass
2024-10-31 07:30:04

For people with large codebases, programming on a laptop can be overwhelming. Your fans are constantly spinning, the language server is continually out of memory, and rebuilds take forever...

Now, in Zed, you can open a project on any machine you can SSH into. The UI runs fully locally to give you 120 frames per second of perfectly configured graphics, but with all the gubbins: language servers, tasks, and terminals run on the remote server where they can take advantage of cloud hardware.

We've been working on our remote development feature for a while. While Zed is built for remote code editing, changing the infrastructure to support SSH required solving a whole bunch of sub-problems, from SSH connection maintenance, to how we build the remote server, to integrating the feature into everything else we have in Zed.

For the SSH connection, we use the ControlMaster setting to maintain a single connection to each host. This means that you can open new terminals and spawn tasks without having to retype your passphrase or re-authenticate. Once connected, we download the remote server for your operating system and architecture. Unlike our normal Linux builds, the remote server can be compiled with musl, which requires no dynamic linking. This lets it work on older distros (where before we ran into compatibility problems with glibc) and on modern share-nothing distros like Nix that don't have a global set of libraries to dynamically link. Once we've established the connection and installed the remote server, we initialize it as a daemon, so that when connections do drop the remote server continues running and on reconnect your language servers are still fully initialized. We also back up any unsaved changes locally, so you never lose your work.

Leave a Comment