Skip to content

File paths with spaces need proper quotingΒ #41

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

Activity

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