Skip to content

Agent generates unquoted shell command when workspace path contains spaces (breaks git worktree add) #11144

@luizv

Description

@luizv

Description

The Warp Agent generated a shell command that interpolated a filesystem path containing spaces without quoting it. The shell split the path on whitespace, which caused git worktree add to receive the wrong number of positional arguments and print its usage: help instead of creating the worktree.

The current workspace is /Users/luizv/Developer/2026-05 Site da Jô — the space in "Site da Jô" is what breaks the command.

Steps to reproduce

  1. Open a workspace whose absolute path contains a space (e.g. ~/Developer/My Project).
  2. Ask the Agent to create a new git worktree (any prompt that triggers it to run git worktree add).
  3. Observe the command it generates.

Actual behavior

The Agent ran:

git worktree add -b turquoise-palo-verde /Users/luizv/.warp/worktrees/2026-05 Site da Jô/turquoise-palo-verde && cd /Users/luizv/.warp/worktrees/2026-05 Site da Jô/turquoise-palo-verde

The shell tokenizes /Users/luizv/.warp/worktrees/2026-05 Site da Jô/turquoise-palo-verde into 4 separate arguments. git worktree add receives too many positional args and prints its usage help. No worktree is created, but the failure mode is non-obvious because the command appears to "complete" — there is no explicit error message saying the path was misquoted.

Expected behavior

The Agent should quote (or escape) paths that may contain spaces or other shell-significant characters when composing commands. Either:

git worktree add -b turquoise-palo-verde "/Users/luizv/.warp/worktrees/2026-05 Site da Jô/turquoise-palo-verde" && cd "/Users/luizv/.warp/worktrees/2026-05 Site da Jô/turquoise-palo-verde"

or equivalent escaping. This is a general shell-safety issue — any path the Agent injects into a command string should be quoted by default, since the Agent cannot assume the user's workspace path is whitespace-free.

Environment

  • Warp version: v25.1.0
  • OS: macOS (Darwin 25.3.0)
  • Shell: zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentAgent workflows, conversations, prompts, cloud mode, and AI-specific UI.area:launch-configsLaunch configurations, workflows, tab configs, and automation entry points.bugSomething isn't working.os:macmacOS-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions