Can't commit with local pre-commit hooks via UI

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

In my repository, I use pixi as my project manager, and I use pixi-based pre-commit hooks. That means that when I trigger a git commit, pixi tasks run before committing (these are all sorts of linters, mostly). My .pre-commit-config.yaml file appears at the bottom of this message.
Another important thing is that I’m connected to a remote Linux machine via SSH. My host machine is a Windows 11 laptop. I tried to connect to the linux machine and install the IDE there, but I only can use an older version (2.1), where things work as expected.

Commits worked just fine until one of the recent updates. the error I get is this:

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
Check YAML...........................................(no files to check)Skipped
Check for large files....................................................Failed
- hook id: check-added-large-files
- exit code: 1

Executable `pixi` not found

Check end-of-file........................................................Failed
- hook id: end-of-file
- exit code: 1

Executable `pixi` not found

Fix trailing whitespace..................................................Failed
- hook id: trailing-whitespace
- exit code: 1

Executable `pixi` not found

Check JSON...........................................(no files to check)Skipped
YAML format..........................................(no files to check)Skipped
TOML format..........................................(no files to check)Skipped
Ruff lint............................................(no files to check)Skipped
Ruff format..........................................(no files to check)Skipped

I don’t know what’s changed recently, but I assume Cursor’s commit is now triggered on some external terminal that does not use my ~/.zshrc (which sets pixi’s executable in $PATH )


# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
  python: python3.10

exclude: (^.pixi/)
repos:
  - repo: local
    hooks:
      - id: check-yaml
        name: Check YAML
        entry: pixi run --environment=lint check-yaml
        language: system
        types: [yaml]
      - id: check-added-large-files
        name: Check for large files
        entry: pixi run --environment=lint check-added-large-files
        language: system
      - id: end-of-file
        name: Check end-of-file
        entry: pixi run --environment=lint end-of-file-fixer
        language: system
        types: [text]
      - id: trailing-whitespace
        name: Fix trailing whitespace
        entry: pixi run --environment=lint trailing-whitespace-fixer
        language: system
        types: [text]
      - id: check-json
        name: Check JSON
        entry: pixi run --environment=lint check-json
        language: system
        types: [json]
      - id: yaml-format
        name: YAML format
        entry: pixi run --environment=lint prettier-fmt
        language: system
        types: [file, yaml]
      # TOML format
      - id: toml-format
        name: TOML format
        entry: pixi run --environment=lint toml-format
        language: system
        types: [toml]
      # Python linting with Ruff
      - id: ruff
        name: Ruff lint
        entry: pixi run --environment=lint ruff-lint
        language: system
        types_or: [python, pyi]
        require_serial: true
      - id: ruff-format
        name: Ruff format
        entry: pixi run --environment=lint ruff-format
        language: system
        types_or: [python, pyi]
        require_serial: true

Steps to Reproduce

  1. install pixi: Installation - Pixi
  2. clone this repository: GitHub - noamgot/pre-commit-bug
  3. important - run pixi run pre-commit-install
  4. create an arbitrary file (e.g. echo "hello" > hello.txt )
  5. try to commit via the UI

Expected Behavior

commits should trigger pre-commit hooks using pixi, as was until recently

Operating System

Windows 10/11

Version Information

Version: 2.4.31 (system setup)
VSCode Version: 1.105.1
Commit: 3578107fdf149b00059ddad37048220e41681000
Date: 2026-02-08T07:42:24.999Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.22631

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report.

This looks like a regression. The git process started from the Source Control UI doesn’t inherit your full shell environment when running over Remote SSH, especially your PATH from ~/.zshrc.

A few things to try:

  1. Check if PATH is correct in Cursor’s integrated terminal. Open a terminal and run which pixi. If it works there, the issue is likely how git operations are launched from the UI.

  2. Try adding this to your settings (JSON):

    {
        "terminal.integrated.inheritEnv": true
    }
    
  3. A more reliable workaround is to use the full path to pixi in your hooks instead of relying on PATH resolution. For example, change pixi run ... to /full/path/to/pixi run ... in .pre-commit-config.yaml.

  4. Another option is to set git.useIntegratedAskPass to false and or configure git.terminalGitEditor. Sometimes these settings affect how the git process environment is created.

Could you also share:

  • Which Cursor version was the last one where this worked?
  • The output of echo $PATH from the integrated terminal on the remote machine?

For now, commits from the terminal should work as a workaround.

thanks for your comment!

pixi is identified in the integrated terminal.

Unfortunately, none of the solutions that you suggested worked for me.

I can’t recall the exact version where it stopped working. I can say that I update Cursor regularly, and I encountered this issue just recently (but can’t tell exactly when - I believe that 2 weeks ago it worked). Also, as I mentioned, I managed to confirm that on linux with version 2.1 it worked as expected.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.