Skip to content

Conversation

@stefanhaller
Copy link
Collaborator

Fix a regression introduced with #4525.

This fixes the problem that background fetching makes lazygit hang when the fetch request needs to prompt for a passphrase. For Mac users who use the keychain to store their ssh passphrases, this can happen when lazygit is running while the machine goes to sleep, because macOS looks the keychain in that case.

This is a regression introduced with a199ed1; it is important to use a PTY
even with credentialStrategy=FAIL, otherwise the fetch command will spew the
credentials request into the UI and then hang.

This fixes the problem that background fetching makes lazygit hang when the
fetch request needs to prompt for a passphrase. For Mac users who use the
keychain to store their ssh passphrases, this can happen when lazygit is running
while the machine goes to sleep, because macOS looks the keychain in that case.
@stefanhaller stefanhaller added the bug Something isn't working label May 23, 2025
@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 67054281 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6705428) Report Missing Report Missing Report Missing
Head commit (2a8ef71) 56452 49020 86.83%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4586) 1 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

For posterity this took me some time to grok so here's my rephrasing that made sense to me:

the credentials request happens regardless of whether the command is run in a PTY or not: but if it is in a PTY, at least we can properly handle that without lazygit hanging.

@jesseduffield jesseduffield merged commit da32b59 into master May 23, 2025
14 checks passed
@jesseduffield jesseduffield deleted the fix-background-fetch-with-credentials-request branch May 23, 2025 10:33
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 23, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | patch | `v0.51.0` -> `v0.51.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.51.1`](https://github.com/jesseduffield/lazygit/releases/tag/v0.51.1)

[Compare Source](jesseduffield/lazygit@v0.51.0...v0.51.1)

<!-- Release notes generated using configuration in .github/release.yml at v0.51.1 -->

#### What's Changed

##### Fixes 🔧

-   Fix lazygit's UI becoming unresponsive when a background fetch asks for a passphrase by [@&#8203;stefanhaller](https://github.com/stefanhaller) in jesseduffield/lazygit#4586

**Full Changelog**: jesseduffield/lazygit@v0.51.0...v0.51.1

</details>

---

### Configuration

📅 **Schedule**: 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 [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4yNi4xIiwidXBkYXRlZEluVmVyIjoiNDAuMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants