Skip to content

Windows support: CRLF in .contextignore + path-separator assumptions #33

Description

@egorfedorov

Problem

CCO assumes POSIX. On Windows it will misbehave:

  • src/contextignore.js:40content.split('\n') leaves a trailing \r on CRLF files, so every .contextignore pattern silently fails to match.
  • globToRegex / path matching assume / separators; Windows paths use \.
  • getProjectRoot() walks up assuming /-rooted paths (utils.js).

Why it matters

Windows is a large share of Claude Code users; right now the ignore-list and project-root detection are effectively broken there, degrading every downstream feature.

Proposal

  • Normalize line endings: split(/\r?\n/) in _parseIgnoreFile.
  • Normalize path separators to / before glob matching; use path.sep-aware logic in getProjectRoot.
  • Add tests with CRLF fixtures and Windows-style paths.

Affected

src/contextignore.js, src/utils.js

Acceptance

  • .contextignore matches identically given LF or CRLF input.
  • Path/glob tests pass with both / and \ separators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions