jesseduffield.lazygit/pkg/gui
Stefan Haller 5055c4fb65 Fetch GitHub pull requests as a background task
Every full refresh includes the PULL_REQUESTS scope, and the worker it
spawns inherited the refresh's foreground/background flag. Full
foreground refreshes happen at startup, after switching repos or
worktrees, and when the terminal regains focus, so the GitHub API
request ran as a foreground task there, keeping Busy() true until it
completed. On a healthy network that's a few hundred milliseconds and
nobody notices; on a very slow one the request can stall for minutes,
and every attempt to switch repos in that window was refused with
"Can't switch repositories while an operation is in progress" even
though lazygit looked completely idle. (The request has no visible
status; at most, a background fetch hanging on the same bad network was
showing its "Fetching..." spinner, pointing the blame at the wrong
operation.)

The switch-safety guard only needs to wait for operations whose
remaining git commands would run against the wrong repo after a switch.
The pull-request fetch runs no git commands at all, and its model
writes are dropped when the repo generation has changed in the
meantime, so there is no reason for it to block switching.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 13:37:23 +02:00
..
context Capture suggestions inputs on the UI thread 2026-07-17 12:35:54 +02:00
controllers Fetch GitHub pull requests as a background task 2026-07-17 13:37:23 +02:00
filetree Clamp the commit-file tree selection when the tree is rebuilt 2026-07-07 18:09:33 +02:00
mergeconflicts Pick both hunks, not the common ancestor, in diff3 conflicts 2026-07-01 09:57:26 +02:00
modes Make Commit.Hash a getter for an unexported hash field 2025-04-29 14:57:15 +02:00
patch_exploring Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00
popup Retire WithWaitingStatusSync 2026-07-17 12:32:32 +02:00
presentation Show renamed files in the custom patch builder 2026-07-04 13:05:09 +02:00
services/custom_commands Remove the RefreshMode field 2026-07-17 12:32:32 +02:00
status Lock the status list when reading it 2026-07-08 18:24:18 +02:00
style Modernize all codes 2025-11-15 10:46:23 +01:00
types Hold the file-path suggestions trie outside the model 2026-07-17 12:35:54 +02:00
background.go Fix data race on the triggerFetch field 2026-07-10 17:16:46 +02:00
command_log_panel.go Write the command log on the UI thread 2026-07-09 08:41:10 +02:00
context.go Bump gocui (and tcell) 2025-12-23 16:49:16 +01:00
context_config.go Remove some unused code 2025-07-08 15:14:45 +02:00
controllers.go Redesign the 'w' worktree-creation flow 2026-07-03 18:53:05 +02:00
dummies.go Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
editors.go Capture suggestions inputs on the UI thread 2026-07-17 12:35:54 +02:00
extras_panel.go Rename Key to Keys in Binding, KeybindingsOpts, and MenuItem 2026-05-25 15:18:18 +02:00
global_handlers.go Read lines based on scroll position instead of a fixed per-notch delta 2026-07-09 09:32:35 +02:00
gui.go Hold the file-path suggestions trie outside the model 2026-07-17 12:35:54 +02:00
gui_common.go Assert that Model() and Context() are only accessed on the UI thread 2026-07-17 12:35:54 +02:00
gui_driver.go Assert that Model() and Context() are only accessed on the UI thread 2026-07-17 12:35:54 +02:00
information_panel.go Rename ModeStatus.Description to InfoLabel 2025-08-14 17:59:38 +02:00
keybindings.go Fold remaining alt bindings into their main fields 2026-05-25 15:32:47 +02:00
layout.go Don't show a transient view whose window is not part of the layout 2026-07-17 12:07:24 +02:00
main_panels.go Run moveMainContextPairToTop before queueing main-view tasks 2026-07-02 17:32:01 +02:00
menu_panel.go Fold remaining alt bindings into their main fields 2026-05-25 15:32:47 +02:00
options_map.go Cleanup: filter out empty keybindings earlier 2026-05-28 19:26:43 +02:00
pty.go Snapshot the view width for command-task rendering on the UI thread 2026-07-17 12:35:54 +02:00
recent_repos_panel.go Remove unused field gui.IsNewRepo 2024-12-01 10:44:26 +01:00
side_panels.go Assign the transient contexts' initial windows from the side panel config 2026-07-17 12:07:24 +02:00
side_panels_test.go Assign the transient contexts' initial windows from the side panel config 2026-07-17 12:07:24 +02:00
tasks_adapter.go Snapshot the view width for command-task rendering on the UI thread 2026-07-17 12:35:54 +02:00
test_mode.go Wait for the event loop to exit in integration tests 2026-07-17 12:35:54 +02:00
view_helpers.go Render content-only when a task reads more lines into a view 2026-07-09 09:32:35 +02:00
views.go Clear tab strips on views that are no longer tabs 2026-06-23 14:15:18 +02:00