Skip to content

Windows: an argument ending in a backslash breaks the command line #100

Description

@ServeurpersoCom

Hi! We use subprocess.h in llama.cpp to launch MCP servers, and we hit this on Windows.

When an argument contains a space and ends with a backslash, like a folder path such as C:\my dir, the child process receives it merged with everything that comes after it, as one single argument with a stray quote in the middle.

What happens: the argument gets wrapped in quotes because of the space, but the trailing backslash is left alone, so it ends up escaping the closing quote. From the child's point of view the quote never closes.

Screenshot below shows the same call before and after a local fix, on a Windows machine.

I can open a PR with a proposed fix and a test case if you want.

Patch: ggml-org/llama.cpp@86b7a53

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions