jesseduffield / jesseduffield/lazygit

lazygit crashes and deletes parent shell on Windows (AV false positive?)

Open
#5,826 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Describe the bug
When running lazygit 0.63.0 or 0.63.1 on Windows, it crashes its host shell shortly after the TUI loads up with error code `0xc0000022`. At this point, the shell in which it was running no longer exists (the exe is physically missing).

In my case, I've tried it on `clink` on top of `cmd`, and using Git Bash. In the former case, `clink.exe` would disappear, and in the latter, I've had `bash.exe` disappear in some instances, and had Starlink break in others.

I've tried when installed via `winget`, with the `.exe` downloaded from GitHub, and a build from the `master` branch (4cf12a5b7bf2119f995af829e4edde33e5919c64). When running the executable I built locally, the contents of `C:\Program Files\Go\bin` also disappear.

### To Reproduce
Steps to reproduce the behavior:

For cmd with clink

1. Run `lazygit`.
2. If not in a git repo, select `n`.
3. `clink_x64.exe` no longer exists and must be reinstalled.

For Git Bash

1. Run `lazygit`.
2. If not in a git repo, select `n`.
3. Cygwin window disappears.
4. Git Bash no longer exists (as in completely gone from the start menu) and Git for Windows must be reinstalled.

If `lazygit.exe` was built locally, also observe `go.exe` disappearing.

### Expected behavior
lazygit should run as normal, no programs should get deleted.

### Screenshots
If applicable, add screenshots to help explain your problem.

Image

Image

Image

Image

### Version info:

* `commit=ce5a8b61bdc9439f2137a1ce9c6a5981c412a0ad, build date=2026-07-04T12:45:51Z, build source=binaryRelease, version=0.63.0, os=windows, arch=amd64, git version=2.55.0.windows.3`
* `commit=aafe61082e7ed383d318fd40e48f85645e6afc7b, build date=2026-07-15T11:34:26Z, build source=binaryRelease, version=0.63.1, os=windows, arch=amd64, git version=2.55.0.windows.3`
* `commit=4cf12a5b7bf2119f995af829e4edde33e5919c64, build date=2026-07-17T10:38:47Z, build source=unknown, version=4cf12a5b, os=windows, arch=amd64, git version=2.55.0.windows.3`

### Terminal info:
What terminal are you using, and which version? For some types of bugs this information can be relevant.

* Windows Terminal/cmd/clink, see screenshots
* Git bash, `GNU bash, version 5.3.15(1)-release (x86_64-pc-cygwin)`

### Additional context
Corporate environment running SentinelOne. I'm not receiving any quarantine notifications, however, given the behaviour of the executables around running lazygit, it almost feels like an AV is clobbering the wrong thing.

```text
Jul 17 13:16:52 |DEBU| RunCommand command="git --version"
Jul 17 13:16:53 |INFO| git --version (152.7556ms)
Jul 17 13:16:53 |DEBU| RunCommand command="git -C C:\\ rev-parse --path-format=absolute --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree"
Jul 17 13:16:53 |ERRO| fatal: not a git repository (or any of the parent directories): .git
command="git -C C:\\ rev-parse --path-format=absolute --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree"
Jul 17 13:16:53 |INFO| git -C C:\ rev-parse --path-format=absolute --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree (wall 145.1121ms, cpu 46.875ms)
Jul 17 13:16:53 |INFO| Error getting repo paths: 'git -C C:\ rev-parse --path-format=absolute --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree' failed: fatal: not a git repository (or any of the parent directories): .git

Jul 17 13:17:11 |INFO| git for-each-ref "--format=%(objectname) %(refname)" refs/heads (wall 196.629ms, cpu 78.125ms)
Jul 17 13:17:11 |INFO| RefsSnapshot took 204.1239ms
Jul 17 13:17:11 |INFO| Refresh took 206.4449ms
Jul 17 13:17:11 |DEBU| RunCommand command="cmd /s /c \"title navsys - Lazygit\""
Jul 17 13:17:11 |DEBU| RunCommand command="git branch --show-current"
Jul 17 13:17:11 |DEBU| RunCommand command="git config --local --get-regexp ^remote\\.[^.]+\\.(url|pushurl)$"
Jul 17 13:17:11 |DEBU| RunCommand command="git stash list -z --pretty=%H|%ct|%gs"
Jul 17 13:17:11 |DEBU| RunCommand command="git tag --list -n --sort=-creatordate"
Jul 17 13:17:11 |DEBU| RunCommand command="git for-each-ref --sort=-committerdate --format=%(HEAD)%00%(refname:short)%00%(upstream:short)%00%(upstream:track)%00%(push:track)%00%(subject)%00%(objectname)%00%(committerdate:unix) refs/heads"
Jul 17 13:17:11 |INFO| cmd /s /c "title navsys - Lazygit" (wall 148.6852ms, cpu 46.875ms)
Jul 17 13:17:12 |DEBU| RunCommand command="git rev-parse --verify --quiet refs/heads/main"
Jul 17 13:17:12 |INFO| git worktree list --porcelain (wall 243.1866ms, cpu 109.375ms)
Jul 17 13:17:12 |DEBU| RunCommand command="git -C C:/software/navsys rev-parse --path-format=absolute --absolute-git-dir"
Jul 17 13:17:12 |ERRO| command="git rev-parse --verify --quiet refs/heads/main"
Jul 17 13:17:12 |INFO| git rev-parse --verify --quiet refs/heads/main (wall 206.2484ms, cpu 78.125ms)
Jul 17 13:17:12 |DEBU| RunCommand command="git rev-list HEAD ^refs/remotes/origin/master"
Jul 17 13:17:12 |DEBU| RunCommand command="git rev-list refs/heads/dev-2.0 ^dev-2.0@{u} ^refs/remotes/origin/master"
Jul 17 13:17:12 |INFO| git -C C:/software/navsys rev-parse --path-format=absolute --absolute-git-dir (wall 207.6217ms, cpu 78.125ms)
Jul 17 13:17:12 |INFO| postRefreshUpdate for worktrees took 0s
Jul 17 13:17:12 |INFO| postRefreshUpdate for localBranches took 0s
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure on Windows with lazygit 0.63.0 or 0.63.1 in cmd/clink and Git Bash, including the locally built executable. Run `lazygit --debug` with `lazygit --logs` as suggested, and compare the behavior with SentinelOne present. Done means lazygit can start and run without deleting or crashing its host shell or other executables.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.