Skip to content

TUI: stop the scan when the user quits before it finishes #7

Closed

Description

@devloop01

Problem

runScreen in tui.go starts sweep.Scan in a goroutine, and Scan has no way to be cancelled. If the user quits while the scan is still running, it keeps walking the disk and forking git until the process exits.

Usually the process exits straight away, so this is harmless. It matters when the user quits while deletions are still running: sweep waits for them ("Finishing deletions…"), and the scan keeps using CPU and disk for that whole time with nobody reading its results.

Idea

Give Scan a context.Context (or a stop flag on Progress) that find, the vetting workers and measure check, and cancel it when the screen quits. The non-interactive path can pass a context that is never cancelled.

Low priority: nothing leaks, since everything ends with the process.

Activity

  1. added a commit that references this issue on Nov 13, 2026
    5abe807
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions