You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TUI scan view: Ctrl+C after completion mislabels the scan "Aborted", notices push the status off-screen, and rendering cost grows quadratically #43
The scan screen is the TUI's main view, and several problems show up on real (especially recursive) scans.
Ctrl+C after a scan has finished calls cancel() and sets aborted = true. The status line flips from "Done" to "Aborted" for a scan that completed successfully, and the program doesn't quit (only q does). The README key table says Ctrl+C means "abort scan / quit", so users press it and see a wrong verdict.
Wildcard and error notices are unbounded and rendered above a fixed-height viewport. A recursive scan emits one wildcard DNS at X; skipping recursive expansion line per wildcard branch, plus cap notices. Each one adds a line while the viewport stays at height-8, so the progress bar and status line get pushed below the alt-screen and disappear.
O(n²) result rendering. Every result re-styles and re-joins the whole result list (strings.Join(m.results, "\n") followed by SetContent). With thousands of hits, the UI falls behind the event stream. Because the TUI consumes events one message at a time, that slowness also back-pressures the scan workers through the events channel.
Paths typed into the form, such as ~/lists/words.txt, are not tilde-expanded (there is no shell), so they fail with "cannot read wordlist".
Evidence
internal/tui/model.go:169-175: the ctrl+c handler doesn't check m.scanView.done.
internal/tui/scan_view.go:82-86,117-119: messages grows without limit and is rendered above the viewport.
internal/tui/scan_view.go:68-75: full re-join and re-render on every result.
internal/tui/form.go:330,389: wordlist and output paths are used verbatim.
Suggested approach
ctrl+c when done → tea.Quit. While running → abort as today.
Cap rendered notices (for example the last 3, plus a "+N more" counter) and subtract their height when sizing the viewport.
Keep results in a ring buffer or a capped slice, and append incrementally (or rebuild content only on a tick or batch) instead of re-joining every message.
Expand a leading ~/ with os.UserHomeDir() for both path fields.
Done when
Ctrl+C on a finished scan quits and never relabels it.
With 50 notices and 10k results the progress bar and status line stay visible, and render time per event is constant (a benchmark or test in scan_view_test.go).
Activity