zed-industries/zed · error

unsupported argument: {:?}

Error message

unsupported argument: {:?}

What it means

Thrown while tokenizing a user-supplied SSH command string when an argument begins with `-` (or appears after the hostname) and is not in the ALLOWED_ARGS whitelist, is not an option-with-value like `-l`, and is not a `-L` port forward. The option string itself (shown via {:?}) is the offending input; parsing stops because unrecognized options could change SSH semantics and are rejected for safety.

Source

Thrown at crates/remote/src/transport/ssh.rs:1721

                } else {
                    anyhow::bail!("Missing port forward format");
                }
            }

            for a in ALLOWED_ARGS {
                if arg == *a {
                    args.push(arg);
                    if let Some(next) = tokens.next() {
                        args.push(next);
                    }
                    continue 'outer;
                } else if arg.starts_with(a) {
                    args.push(arg);
                    continue 'outer;
                }
            }
            if arg.starts_with("-") || hostname.is_some() {
                anyhow::bail!("unsupported argument: {:?}", arg);
            }
            let mut input = &arg as &str;
            // Destination might be: username1@username2@ip2@ip1
            if let Some((u, rest)) = input.rsplit_once('@') {
                input = rest;
                username = Some(u.to_string());
            }

            // Handle port parsing, accounting for IPv6 addresses
            // IPv6 addresses can be: 2001:db8::1 or [2001:db8::1]:22
            if input.starts_with('[') {
                if let Some((rest, p)) = input.rsplit_once("]:") {
                    input = rest.strip_prefix('[').unwrap_or(rest);
                    port = p.parse().ok();
                } else if input.ends_with(']') {
                    input = input.strip_prefix('[').unwrap_or(input);
                    input = input.strip_suffix(']').unwrap_or(input);
                }

View on GitHub (pinned to f4178619ac)

Solutions

  1. Remove the unsupported flag from the SSH connection options in Zed settings
  2. Use only arguments from the allowed set (e.g. -p, -i, -o, -L)
  3. Put advanced options in ~/.ssh/config instead of passing them as CLI args
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/remote/src/transport/ssh.rs:1721 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/460548f46eb69e83. Report an issue: GitHub.