jesseduffield / jesseduffield/lazygit
Crashes when folder/repo has a "&" in the name
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
### Describe the bug
**Lazygit** crashes when the folder has a "&" in the name (here, "Rapports&Notes" and "test&aaa"), even if opened in a junction named w/o the ampersand.
### To Reproduce
Steps to reproduce the behavior:
1. Move to a folder which name contains an ampersand.
2. Launch **Lazygit** in that folder.
3. Crash happens.
Alternatively (after the 1st attempt):
1. Open **Lazygit** in a normal folder.
2. Open recent repos (1 > Enter).
3. Open a repo containing an ampersand.
4. Crash happens.
### Expected behavior
Not crash.
### Error message
2026/07/07 08:58:00 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues
*errors.errorString 'aaa' n'est pas reconnu en tant que commande interne
ou externe, un programme ex�cutable ou un fichier de commandes.
[Translation: "errors.errorString 'aaa' is not recognized as an internal or external command, executable program, or command file."]
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:213 (0x7ff667bb8db4)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:109 (0x7ff667bb7a78)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj_runner.go:46 (0x7ff667bb729d)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/cmd_obj.go:198 (0x7ff667bbd8c2)
/home/runner/work/lazygit/lazygit/pkg/commands/oscommands/os_windows.go:41 (0x7ff667bbd87a)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:1072 (0x7ff667e01365)
/home/runner/work/lazygit/lazygit/pkg/gui/layout.go:236 (0x7ff667e09bb9)
/home/runner/work/lazygit/lazygit/pkg/gui/layout.go:171 (0x7ff667e094d9)
/home/runner/work/lazygit/lazygit/pkg/gocui/gui.go:693 (0x7ff667b170f9)
/home/runner/work/lazygit/lazygit/pkg/gocui/gui.go:1159 (0x7ff667b1923f)
/home/runner/work/lazygit/lazygit/pkg/gocui/gui.go:787 (0x7ff667b17979)
/home/runner/work/lazygit/lazygit/pkg/gocui/gui.go:743 (0x7ff667b1742a)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:947 (0x7ff667e0023d)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:958 (0x7ff667e00948)
/home/runner/work/lazygit/lazygit/pkg/utils/utils.go:81 (0x7ff667b33b16)
/home/runner/work/lazygit/lazygit/pkg/gui/gui.go:957 (0x7ff667e0087f)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:285 (0x7ff667e767ba)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:49 (0x7ff667e7674a)
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:177 (0x7ff667e78e45)
/home/runner/work/lazygit/lazygit/main.go:23 (0x7ff667e7a198)
/opt/hostedtoolcache/go/1.25.11/x64/src/internal/runtime/atomic/types.go:194 (0x7ff66774a1bd)
/opt/hostedtoolcache/go/1.25.11/x64/src/runtime/asm_amd64.s:1693 (0x7ff667786901)
### 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.52.0.windows.1
### Terminal info:
PowerShell 7.6.3, Windows Terminal 1.23.251216003
Contributor guide
Research direction
Start in pkg/commands/oscommands/cmd_obj_runner.go and pkg/commands/oscommands/os_windows.go, following the stack trace from command execution into the Windows-specific path. Reproduce with a repository whose path contains an ampersand, using --debug and --logs if needed. Done means Lazygit opens the repository and recent-repository entry without crashing on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100