Fix hang on quit when confirmOnQuit is true - #5919
Merged
Merged
Conversation
Every caller passes an f that unconditionally returns nil, so f's error return has never carried anything: the value is dead weight, and it occupies the one channel the wait itself needs to report that it couldn't run f at all. Drop it, so that the error the wait returns can only ever mean that. Work that can fail hands its error back through a captured variable, the way the background fetch already hands back four values, which keeps the two outcomes distinguishable at a call site that has both. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…dAndWait Right now the function always returns nil, but this will change later in this branch, so handle errors properly. Without that, the first capture that assigns env.git would not run, leave env.git nil, and subsequent code would crash. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nothing dequeues user events once MainLoop has returned, so a worker blocked in OnUIThreadAndWait is blocked for good. The assertion records that; the next commit makes the wait give up instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Quitting with confirmOnQuit set hung for three seconds and printed "cannot kill child process", but only with a clean working tree. Closing the confirmation pops the context before running its handler, so the files panel is re-focused and re-renders the main view, and only then does the handler return ErrQuit. With no changed files that render is a string task, whose whole body is one hop to the UI thread — a hop that is never served, because the handler's ErrQuit has meanwhile brought the main loop down. The task can't finish, so the ViewBufferManager.Close that follows waits for it until it times out. (With changed files it's a command task instead, and every blocking point in one of those selects on the stop channel, so Close gets through.) A wait for the UI thread now ends when the loop does. That also covers the command task's own hops, which are stopped only in between them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Aug 13, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | patch | `v0.64.0` → `v0.64.1` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary> ### [`v0.64.1`](https://github.com/jesseduffield/lazygit/releases/tag/v0.64.1) [Compare Source](jesseduffield/lazygit@v0.64.0...v0.64.1) <!-- Release notes generated using configuration in .github/release.yml at v0.64.1 --> #### What's Changed This fixes a few regressions that were introduced in the [last release](https://github.com/jesseduffield/lazygit/releases#release-v0.64.0), and some long-standing bugs that I didn't see any reason to hold back until the next big one. ##### Fixes 🔧 - Fix transitions of entering and exiting filtering mode (e.g. by path or author) by [@​stefanhaller](https://github.com/stefanhaller) in [#​5897](jesseduffield/lazygit#5897) - Fix race in "Stash staged changes" on git versions before 2.35.0 by [@​stefanhaller](https://github.com/stefanhaller) in [#​5903](jesseduffield/lazygit#5903) - Fix several problems with repos whose git dir lives outside the working tree by [@​stefanhaller](https://github.com/stefanhaller) in [#​5910](jesseduffield/lazygit#5910) - Update the UI after stash operations in a single frame by [@​stefanhaller](https://github.com/stefanhaller) in [#​5905](jesseduffield/lazygit#5905) - Honor the conflict-marker-size gitattribute by [@​stefanhaller](https://github.com/stefanhaller) in [#​5902](jesseduffield/lazygit#5902) - Fix hang on quit when confirmOnQuit is true by [@​stefanhaller](https://github.com/stefanhaller) in [#​5919](jesseduffield/lazygit#5919) - Fix pull requests silently disappearing until lazygit is restarted by [@​stefanhaller](https://github.com/stefanhaller) in [#​5921](jesseduffield/lazygit#5921) ##### Maintenance ⚙️ - Don't let integration tests race a background git repack by [@​stefanhaller](https://github.com/stefanhaller) in [#​5898](jesseduffield/lazygit#5898) - update Nix flake dependencies by [@​TyceHerrman](https://github.com/TyceHerrman) in [#​5894](jesseduffield/lazygit#5894) - Simplify the run\_integration\_tests.sh script by [@​stefanhaller](https://github.com/stefanhaller) in [#​5908](jesseduffield/lazygit#5908) - Bump actions/setup-go from 6 to 7 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​5843](jesseduffield/lazygit#5843) - Bump github.com/kyokomi/emoji/v2 from 2.2.13 to 2.2.14 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​5813](jesseduffield/lazygit#5813) - Bump mheap/github-action-required-labels from 5.5.2 to 5.6.0 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​5769](jesseduffield/lazygit#5769) - Bump github.com/lucasb-eyer/go-colorful from 1.4.0 to 1.4.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​5916](jesseduffield/lazygit#5916) - Bump JamesIves/github-sponsors-readme-action from 1.6.0 to 1.6.1 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​5917](jesseduffield/lazygit#5917) **Full Changelog**: <jesseduffield/lazygit@v0.64.0...v0.64.1> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODguMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4OC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When confirmOnQuit is true, quitting would sometimes hang for three seconds and then print "cannot kill child process". Concretely, this happened whenever the Files panel was focused but there were no changed files (the main view shows "No changed files").
This is a regression in 0.64.0, it worked before.
Fixes #5918.