Skip to content

List an archive's names in one go - #207

Merged
dhh merged 4 commits into
mainfrom
simpler-archive-names
Nov 21, 2026
Merged

dhh merged 4 commits into
mainfrom
simpler-archive-names

Conversation

@dhh

@dhh dhh commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This simplifies #179. It streamed an archive's names in as bsdtar printed them, through a helper class of its own that kept the run's process group, its stderr and an output budget, decoded bsdtar's escapes, counted what it didn't show, and had a sentence each for an empty, encrypted, slow or unreadable archive and a missing bsdtar. Names arriving one part at a time also needed the preview to hold its scroll position and ↑/↓ to wait for them.

Now bsdtar runs once, off the UI thread, and is waited for (five seconds at most). Its output is read as it comes and it's stopped once 500 names (or 256 KB of them) are in; those are shown as the opening of a text is. When bsdtar is missing, fails, lists nothing or takes too long, one sentence says the archive couldn't be listed. The details list archives on a thread of their own, so the rest of what they read never waits on a slow one.

🤖 Generated with Claude Code

@dhh

dhh commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Before and after, with a made-up project.zip: the same names, without the count line above them (bsdtar's whole listing is no longer counted, only the first 500 names shown).

Before: a count line above the names. After: just the names

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

Archive names are collected off the UI thread and shown together, with one fallback sentence when listing fails.

  • Archive previews show one bounded text listing in both views.

Reviews (4) · Last reviewed commit: "Show an archive's names as they are, not..." · Reviewed by Greptile

Comment thread src/previewer.cpp Resolved
Comment thread src/backend.cpp Resolved
Comment thread src/previewer.cpp Resolved
dhh and others added 3 commits November 21, 2026 13:16
helper class of its own that kept the run's process group, its stderr
and an output budget, decoded bsdtar's escapes, counted what it didn't
show, and had a sentence each for an empty, encrypted, slow or
unreadable archive and a missing bsdtar. Names arriving one part at a
time also needed the preview to hold its scroll position and ↑/↓ to
wait for them.

Now bsdtar runs once, off the UI thread with the rest of what the
preview and the details read, and is waited for (five seconds at
most). The first 500 names are shown as the opening of a text is; when
bsdtar is missing, fails, lists nothing or takes too long, one sentence
says the archive couldn't be listed.

Co-Authored-By: GM <gianmarcomorales@icloud.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bsdtar's whole listing was read into memory before its first 500 names
were taken, so an archive of millions of entries held all of them, and
was waited out. Its output is now read as it comes, and bsdtar is
stopped once 500 names (or 256 KB of them) are in.

The details listed an archive on the threads that read every item's
permissions and trash notes, so a slow listing kept those waiting.
Listings now take a thread of their own, one at a time, and one the
selection has moved past isn't started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Once the names shown were in, the loop still took whatever bsdtar had
left when it had already exited, adding it after the ellipsis. It now
stops there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh force-pushed the simpler-archive-names branch from d6bcff6 to 4d9e585 Compare November 21, 2026 12:17
Comment thread src/previewer.cpp Resolved
bsdtar lists a backslash in a name as two, and a byte it can't print
as an octal escape, so "café \ two.txt" showed with a doubled
backslash. Each line is now decoded back to the name before it's shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit 896dae4 into main Nov 21, 2026
2 checks passed
@dhh
dhh deleted the simpler-archive-names branch November 21, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant