let to_uri t =
let scheme, host, port, userinfo =
match t.connection with
| `Ssh {Ssh.address; port; user;} -> Some "ssh", Some address, port, user
| `Localhost -> None, None, None, None
in
let query =
let {binary; command_name; options; command_option} =
t.default_shell in
let shell_spec = [command_name] @ options @ [command_option] in
["shell", [String.concat ~sep:"," shell_spec]]
in
Uri.make ?scheme ?userinfo ?host ?port
?path:(Option.map ~f:Path.to_string t.playground)
~query ()