Skip to content

[Bug] Fails to execute on Windows due to hardcoded shell paths and invalid command syntax #1

@gdumoulin

Description

@gdumoulin

Description

The claude-commit extension is currently unusable on a native Windows environment due to two related issues:

  1. Default execution fails: By default, the extension attempts to execute the claude command via /bin/bash, a path that does not exist on Windows. This results in a spawn /bin/bash ENOENT error.
  2. Custom path execution fails: Attempting to work around this by providing a direct, valid Windows path to the claude executable in the settings also fails. The extension wraps the provided path in single quotes ('...') when validating it with the --version command. This syntax is invalid for the Windows shell (cmd.exe or PowerShell), causing a file syntax error.

My local installation of claude-cli is correct and fully functional, as I can run it manually from the command line without any issues.

Steps to Reproduce

This bug manifests in two ways:

Scenario 1: Using the default (empty) path

  1. Install the claude-commit extension in VS Code on a Windows machine.
  2. Ensure claude-cli is installed and accessible in the system's PATH.
  3. Leave the "Claude CLI Path" setting empty.
  4. Stage changes in a Git repository and click the "Claude Commit" icon.
  5. Result: The following error appears:
    Error: Failed to generate commit message: Claude CLI execution failed: spawn /bin/bash ENOENT
    

Scenario 2: Providing a custom Windows path

  1. In the extension settings, set the "Claude CLI Path" to a valid Windows path (e.g., C:\Users\g_dum.A15GDM2023\scoop\apps\nodejs-lts\current\bin\claude).
  2. Stage changes and click the "Claude Commit" icon.
  3. Result: A different error appears, related to command syntax:
    Error: Failed to generate commit message: Custom Claude CLI path not valid: C:\\Users\\g_dum.A15GDM2023\\scoop\\apps\\nodejs-lts\\current\\bin\\claude - Command failed: 'C:\\Users\\g_dum.A15GDM2023\\scoop\\apps\\nodejs-lts\\current\\bin\\claude' --version
    La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte.
    

Proof of Correct Local Installation

To confirm the issue is not with my local environment, I can execute the command successfully directly in my terminal:

PS C:\Users\g_dum.A15GDM2023\scoop\apps\nodejs-lts\current\bin> .\claude --version
1.0.102 (Claude Code)

Environment

  • Operating System: Windows 11
  • VS Code Version: 1.103.2
  • Extension Version: 1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions