Skip to content

electron/providers.js contains a literal NUL byte, so grep and git treat it as binary #441

Closed

Description

@currentbits

electron/providers.js:~475 builds a cache key as \${bin}${env.PATH || ""}`with a **raw NUL byte** in the source rather than the\0` escape.

Consequence: file electron/providers.js reports data, and grep silently returns zero matches on the whole file — grep -n 'contextTokens' electron/providers.js prints nothing even though the string is there. Same for git diff ("Binary files differ") and anything else that sniffs for NUL. I hit this three times while working on #317 and initially concluded the provider catalog didn't contain fields it did contain.

Fix is one character: write \\0 instead of the literal byte. Identical runtime value, file becomes text again.

Found while working on #317; not fixed there to keep that diff scoped.

Activity

  1. added
    bug
    on Aug 18, 2026
  2. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Fixed in 160e14e as part of #442 — the NUL was the cache-key separator in providers.js defaultWhich, now the \0 escape. providers.js is plain UTF-8 text again and a regression test asserts no raw NUL.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions