docs/features/ssh.md
Activation: command-line only — no palette command or settings toggle. Launch Fresh with a remote path as the first argument (see forms below).
Fresh supports editing files on remote machines via SSH. Two wire forms are accepted and do the same thing — pick whichever is easier to type:
user@host:path[:line[:col]]ssh://[user@]host[:port]/path[:line[:col]]The URL form is the only one that accepts a non-standard port and is
the only one where the user is optional (it defaults to $USER /
$USERNAME).
# scp-style: open a specific file
fresh [email protected]:/etc/nginx/nginx.conf
# scp-style: open home directory in file explorer
fresh user@host:~
# scp-style: open with line number
fresh user@host:/var/log/app.log:100
# URL-style: default user from the environment
fresh ssh://host.example/etc/hosts
# URL-style: non-standard SSH port
fresh ssh://[email protected]:2222/etc/nginx/nginx.conf
# URL-style: line and column
fresh ssh://alice@host/home/alice/src/main.rs:42:7
Features:
[SSH:user@host] indicatorssh -t … 'cd <workspace>; exec $SHELL -l'), rooted at the workspaceUnder the hood, attaching to an SSH host switches the workspace's backend to that host — file I/O, the embedded terminal, spawned LSP servers, and any process Fresh launches all run on the remote.
Because the integrated terminal re-parents itself onto the remote host, it runs the remote $SHELL as a login shell and the local terminal.shell override does not apply. Interactive auth prompts (key passphrase, password, 2FA) surface inside the terminal pane on first open.
Requirements:
If you need an editor that survives connection drops, consider running Fresh directly on the remote host in daemon mode:
ssh user@host
fresh -a # start a daemon on the remote host
# if SSH disconnects, just reconnect and reattach:
ssh user@host
fresh -a
You can also pair SSH with tmux for a similar effect—run tmux on the remote host and launch Fresh inside it. Daemon mode has the advantage of being built into Fresh, so editor state (open files, terminals, undo history) is preserved without an external multiplexer.
You don't need Fresh on every machine you edit. Pass a remote target directly to a daemon: the remote URL becomes the daemon's startup authority, so the daemon runs on the machine you launched it from (e.g. a jump/bastion host) and edits the remote over SSH. The target still only needs Python 3; Fresh is installed solely on the box you launch from.
# On the one box where Fresh is installed:
fresh -a webserver [email protected]:/etc/nginx/nginx.conf
# Detach (Command Palette → "Detach"), then reattach later from the same box:
fresh -a webserver
Notes:
fresh -a webserver is enough to reconnect.Ctrl+P → "Orchestrator: New Workspace") spawns an additional workspace with its own authority, so a local workspace and a remote workspace (or workspaces on different hosts) can run side by side in one Fresh daemon.