@@ -828,6 +828,8 @@ or removing a command fails until the table changes in the same commit.
828828| `remote.sshConfigHosts` | List the Host aliases of the user's SSH configuration for an import |
829829| `remote.mottyHosts` | List the SSH hosts saved in Motty for an import |
830830| `remote.listWslDistributions` | List the WSL distributions installed on this Windows machine |
831+ | `remote.preferences` | Read the remote workspace settings and what each automatic value resolves to |
832+ | `remote.editPreferences` | Set the SSH program or the reconnect limit, or make one automatic again |
831833| `git.historyRewritePreview` | Review undo, message edit, squash, or drop with complete messages, eligibility, and an immutable checkout expectation |
832834| `git.remotes` | Return configured fetch remote names and URLs |
833835| `git.tags` | Return tag names, tag object IDs, target IDs, dates, and annotations |
@@ -5698,6 +5700,12 @@ Every field becomes an allowlisted SSH option; options that run a local
56985700command, such as `ProxyCommand`, are only read from the user's own SSH
56995701configuration.
57005702
5703+ `remote.probe`, `remote.connect`, `remote.effectiveSettings` and
5704+ `remote.sshConfigHosts` also take an optional `preferences`: the text of the
5705+ remote preferences document (see "Remote workspace preferences"), `null` or
5706+ absent when it does not exist. Its SSH program is the OpenSSH client they
5707+ start; a damaged document is `parse_failed` before anything starts.
5708+
57015709Core runs the system `ssh` with the probe of
57025710[`remote-workspace-protocol-v1`](remote-workspace-protocol-v1.md)'s bootstrap
57035711and relays every OpenSSH question through the same AskPass transport as Git.
@@ -5917,6 +5925,62 @@ its redacted message for display; it is never logged. Cancellation and the
59175925bound are `cancelled` and `timed_out`. Nothing is saved: the window lists
59185926the distributions each time it opens.
59195927
5928+ #### Remote workspace preferences
5929+
5930+ The settings page "Tools › Remote Workspace" edits two values that apply to
5931+ every connection. Native clients keep them in one machine-local document,
5932+ read it, and publish the `document` an edit returns atomically, as for the
5933+ saved connections; Core validates the document, applies every edit and
5934+ tells what each automatic value resolves to.
5935+
5936+ `remote.preferences` accepts `{ document: string|null, homeDirectory? }`
5937+ and returns `{ preferences, ssh, reconnect, storage, sshConfig? }`:
5938+
5939+ - `preferences` is `{ sshProgram, reconnectLimitSeconds }`, the stored
5940+ values; `null` is automatic.
5941+ - `ssh` is `{ source, path, status }`, the OpenSSH client every connection
5942+ starts. `source` is `setting` for a stored program and `automatic`
5943+ otherwise, which is the first executable `ssh` (`ssh.exe` on Windows) in an
5944+ absolute directory of Core's `PATH`. `path` is that program, or `null` when
5945+ automatic finds none; then the system looks `ssh` up when it starts.
5946+ `status` is `found`, `missing` or `notExecutable`; a stored program that
5947+ disappeared is reported, not refused, so the page can show it.
5948+ - `reconnect` is `{ source, limitSeconds, delaysMilliseconds }`: how long a
5949+ workspace whose connection dropped keeps reconnecting (automatic: 60
5950+ seconds) and the pauses before each attempt. Pauses start at one second,
5951+ double up to 30 seconds and add up to the limit; the last one is shortened
5952+ to fit. A limit of 0 never reconnects, so the list is empty. Clients wait
5953+ these pauses and decide nothing else about the schedule.
5954+ - `storage` is `{ relativePath: "remote/preferences.json", maximumBytes:
5955+ 16384 }`.
5956+ - `sshConfig` is `{ path, exists }` for `.ssh/config` below `homeDirectory`,
5957+ returned only with one, for the page to show and open. A relative home is
5958+ `invalid_request` with `{ field: "homeDirectory", reason: "relative" }`.
5959+
5960+ `remote.editPreferences` accepts `{ document }` with exactly one of:
5961+
5962+ - `sshProgram: { path: string|null }` stores the trimmed absolute path of an
5963+ existing executable file, or makes the program automatic with `null`.
5964+ - `reconnectLimit: { seconds: number|null }` stores 0 to 3600 seconds, or
5965+ makes the limit automatic with `null`.
5966+
5967+ The result is `{ changed, document: string|null }`; an unchanged edit
5968+ returns a `null` document and must not create a source. Neither or both
5969+ fields is `invalid_request` with `{ field: "operation", reason: "invalid"
5970+ }`; a refused value is `invalid_request` with `{ field, reason }`, where
5971+ `field` is `sshProgram` or `reconnectLimitSeconds` and `reason` is
5972+ `invalid` (empty, surrounding spaces or control characters), `tooLong`
5973+ (over 4096 bytes), `relative`, `missing`, `notExecutable` or `outOfRange`.
5974+
5975+ A document of more than 16 KiB, that cannot be decoded, has unknown fields
5976+ or another version than 1, or holds a value an edit would refuse other than
5977+ a missing or not executable program is `parse_failed` with the same
5978+ `details`. The document omits automatic values.
5979+
5980+ Native clients keep the document below their platform user-preference
5981+ directory, never on a host, in a workspace or in an installed package. This
5982+ user-settings resource does not affect code signatures or update deltas.
5983+
59205984#### Remote connections that stay open
59215985
59225986`remote.connect` takes `{ connection, servers: [{ target, path, sha256 }],
0 commit comments