Skip to content

File paths with spaces need proper quoting #41

@konard

Description

@konard

🐛 Bug Description

File paths containing spaces fail to be properly quoted when interpolated through command-stream, causing commands to interpret them as multiple arguments.

🔴 Impact

  • Operations on files with spaces in names fail
  • Common on Windows/Mac with default folders like "Program Files"
  • Affects file operations, directory navigation, and path handling

📝 Problem Example

```javascript
const filePath = "/Users/john/My Documents/report.txt";
// ❌ Fails - interpreted as multiple arguments
await $`cat ${filePath}`;
// Shell sees: cat /Users/john/My Documents/report.txt
// Interprets as: cat /Users/john/My + Documents/report.txt
```

🔧 Workaround

Manually quote the path:
```javascript
await $`cat "${filePath}"`;
```

🔗 References

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