mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
Each status used to start a spinner render loop of its own, running on a worker that inherited the foreground/background flavor of the status's owner, and exiting only once the entire status stack was empty. That shape had a real bug: a foreground operation's loop could be kept alive by someone else's status. Finish a quick operation with a waiting status while a background fetch's "Fetching..." status is still showing, and the operation's render loop — a foreground worker task — keeps ticking until the fetch ends. Busy() stays true for that whole time, so repo switching is refused even though nothing is in flight anymore; with a fetch hanging on a slow network, that means minutes. The shape was also wasteful: overlapping statuses were each drawn by their own loop (plus a duplicate whenever a task was paused and resumed while another status was showing), all redundantly redrawing the same top status. Replace the per-status loops with a single loop owned by the status stack as a whole: whoever shows the first status starts it, and it exits after drawing a final empty frame once the last status is removed. The claim/release methods on StatusManager keep the loop flag's transitions atomic with the stack under the one mutex, so a status added while the loop is about to exit starts a fresh loop instead of going unrendered. The loop always runs as a background task now: rendering issues no git commands, so it never needs to block repo switching, and a foreground operation's busy-ness is already carried by its own worker task. This is what fixes the bug above, and it retires the need to thread a foreground/background flag through the waiting-status helpers altogether. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| helpers | ||
| attach.go | ||
| base_controller.go | ||
| basic_commits_controller.go | ||
| bisect_controller.go | ||
| branches_controller.go | ||
| command_log_controller.go | ||
| commit_description_controller.go | ||
| commit_message_controller.go | ||
| commits_files_controller.go | ||
| common.go | ||
| confirmation_controller.go | ||
| context_lines_controller.go | ||
| custom_patch_options_menu_action.go | ||
| diffing_menu_action.go | ||
| edit_config_action.go | ||
| files_controller.go | ||
| filter_controller.go | ||
| filtering_menu_action.go | ||
| git_flow_controller.go | ||
| global_controller.go | ||
| jump_to_side_window_controller.go | ||
| list_controller.go | ||
| list_controller_trait.go | ||
| local_commits_controller.go | ||
| local_commits_controller_test.go | ||
| main_view_controller.go | ||
| menu_controller.go | ||
| menu_key.go | ||
| merge_conflicts_controller.go | ||
| options_menu_action.go | ||
| patch_building_controller.go | ||
| patch_explorer_controller.go | ||
| patch_explorer_controller_test.go | ||
| prompt_controller.go | ||
| quit_actions.go | ||
| reflog_commits_controller.go | ||
| remote_branches_controller.go | ||
| remotes_controller.go | ||
| remotes_controller_test.go | ||
| rename_similarity_threshold_controller.go | ||
| screen_mode_actions.go | ||
| scroll_off_margin.go | ||
| scroll_off_margin_test.go | ||
| search_controller.go | ||
| search_prompt_controller.go | ||
| shell_command_action.go | ||
| side_window_controller.go | ||
| snake_controller.go | ||
| staging_controller.go | ||
| stash_controller.go | ||
| status_controller.go | ||
| sub_commits_controller.go | ||
| submodules_controller.go | ||
| suggestions_controller.go | ||
| switch_to_diff_files_controller.go | ||
| switch_to_focused_main_view_controller.go | ||
| switch_to_sub_commits_controller.go | ||
| sync_controller.go | ||
| tags_controller.go | ||
| toggle_whitespace_action.go | ||
| undo_controller.go | ||
| vertical_scroll_controller.go | ||
| view_selection_controller.go | ||
| workspace_reset_controller.go | ||
| worktrees_controller.go | ||