Skip to content

Jobs pop up in new window on Windows #1357

@floyd-may

Description

@floyd-may

Description

When my pre-commit runs on Windows, it runs its job in an sh -c wrapper which causes a new window to pop up briefly while the job is running. I can't find a way to disable that behavior.

lefthook.yml

no_tty: true
output:
  - failure
pre-commit:
  jobs:
    - name: format-staged
      run: pnpm exec lint-staged

Verbose Logs

+ '[' '' = 0 ']'
+ call_lefthook run pre-commit
+ test -n ''
+ lefthook.exe -h
+ lefthook.bat -h
+ <path omitted for privacy/security>node_modules.pnpmlefthook-windows-x64@2.1.2node_moduleslefthook-windows-x64binlefthook.exe -h
++ git rev-parse --show-toplevel
+ dir=<path omitted for privacy/security>
++ uname
++ tr '[:upper:]' '[:lower:]'
+ osArch=mingw64_nt-10.0-19045
++ uname -m
++ sed 's/aarch64/arm64/;s/x86_64/x64/'
+ cpuArch=x64
+ test -f <path omitted for privacy/security>/lefthook-mingw64_nt-10.0-19045-x64/bin/lefthook.exe
+ test -f <path omitted for privacy/security>/@evilmartians/lefthook/bin/lefthook-mingw64_nt-10.0-19045-x64/lefthook.exe
+ test -f <path omitted for privacy/security>/@evilmartians/lefthook-installer/bin/lefthook.exe
+ test -f <path omitted for privacy/security>/lefthook/bin/index.js
+ <path omitted for privacy/security>/node_modules/lefthook/bin/index.js run pre-commit
│  [lefthook] git: git version
│             out: git version 2.39.2.windows.1
│  [lefthook] git: git rev-parse --path-format=absolute --show-toplevel --git-path hooks --git-path info --git-dir
│             out: <path omitted for privacy/security>
│                  <path omitted for privacy/security>/.git/hooks
│                  <path omitted for privacy/security>/.git/info
│                  <path omitted for privacy/security>/.git
│  loading config: <path omitted for privacy/security>\lefthook.yml
sync hooks: ✔️ (pre-commit)
│  [lefthook] git: git diff --name-only --cached --diff-filter=ACMR
│             out: lefthook.yml
│  [lefthook] git: git diff --name-only --cached --diff-filter=ACMRD
│             out: lefthook.yml
│  [lefthook] git: git status --short --porcelain -z
│             out: M  lefthook.yml
│  [lefthook] filtered [ ]: lefthook.yml
│             filtered [x]: lefthook.yml
│  [lefthook] run: "sh" -c "pnpm exec lint-staged "

Commands to reproduce

export LEFTHOOK_VERBOSE=true

Lefthook version

2.1.2

Possible solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    WindowsWindows casebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions