Something went wrong. Try again.
The agentic engineering control plane for the posthuman future
Something went wrong. Try again.
623 B · 18 lines
C
at main
12345678910111213141516171819#pragma once
#include <QString>
// Escape shell-sensitive characters in a path by prefixing each with a// backslash. Mirrors ghostty's Ghostty.Shell.escape// (macos/Sources/Ghostty/Ghostty.Shell.swift): the character set and its// order are upstream's, and the literal backslash is first so the// backslashes inserted below are never re-escaped.[[nodiscard]] inline QString shellEscapePath(const QString& path){ static const QString kEscape = QStringLiteral("\\ ()[]{}<>\"'`!#$&;|*?\t"); QString out = path; for (const QChar ch : kEscape) { out.replace(ch, QStringLiteral("\\") + ch); } return out;}