Skip to content

Match Toolkit Windows quoting for copied QuPath terminal commands #18

Closed

Description

@guijacquemet

Failure mechanism

QuPath's LcDialog.shellQuote wraps arguments containing spaces in double quotes and escapes ", but does not implement the Windows C runtime backslash-doubling rules. A file/folder path such as C:\\My Data\\ ends in a backslash immediately before the added closing quote. The command-line parser treats that backslash as escaping the quote, changing how the command is parsed. Sequences of backslashes preceding embedded quotes are also mishandled.

The Toolkit already implements the correct argument quoting algorithm in command._quote_windows and retains shared quoting test vectors. The same mismatch was reported for the Fiji host in Fiji #27.

Recommended fix

Implement the same Windows per-argument quoting logic and assert parity with every Toolkit quote vector. Preserve POSIX behavior. State that a cmd.exe line is not a PowerShell command (the copied Python snippet is preferable there).

Acceptance criteria

  • Trailing backslashes, quotes preceded by backslashes, UNC paths and spaced Windows paths match the shared quote vectors.
  • A generated QuPath terminal command preserves its argument vector under the Windows C runtime parser.
  • GUI copy tests validate Windows cases, not only simple POSIX paths.

Priority: P2 — copied commands can run with incorrect image or folder paths on Windows. Source comparison; not tested on Windows in this audit.

Activity

  1. guijacquemet commented on Oct 14, 2026

    @guijacquemet
    ContributorAuthor

    Addressed on main (checked 14 Oct 2026): LcDialog.quoteWindows doubles backslash runs before a quote and at the end of the text, and the copy-as-command line quotes every word through shellQuote. Closing.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions