Stream a new box's first-run setup into the create dialog - #219
Open
kacperpaczos wants to merge 2 commits into
Open
Stream a new box's first-run setup into the create dialog#219kacperpaczos wants to merge 2 commits into
kacperpaczos wants to merge 2 commits into
Conversation
distrobox create only writes the container config; the container is built on its first enter, which is where "Starting container" / "Installing basic packages" come from. That setup used to run in the terminal opened after creating. Trigger it with a no-op `distrobox enter -- true` right after create and stream it through the same channel, so the dialog shows the setup too and the box is genuinely ready by the time it closes. Factor the spawn/stream/wait into one stream_distrobox helper shared by both passes. The enter arguments are a small pure function with a unit test, and the e2e test now also checks the box runs a command once the stream is done.
This was referenced Aug 23, 2026
A helper that returned a four-element literal, and a test that compared it to the same literal, added nothing over writing the arguments at the call site. The end-to-end test (ignored by default) still checks that the streamed create leaves a ready box.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you create a box, the streaming dialog shows the output of
distrobox create— butcreateonly writes the container's config. The real work (Starting container…,Installing basic packages…, and the rest) happens the first time the box is entered, and until now that scrolled past in the terminal we opened afterwards instead of in the dialog you were already watching.This runs a throwaway no-op enter (
distrobox enter <box> -- true) right after create, streamed through the exact same channel, so the first-run setup shows up in the dialog too. By the time the dialog closes, the box is genuinely built and ready.The per-command spawn/stream/wait logic is factored into one
stream_distroboxhelper that both the create pass and the setup pass go through, so both stream identically. The dialog already waited on the producer finishing rather than on any single stream, so it needed no changes. The enter arguments are a small pure function with a unit test, and the existing end-to-end streaming test now also asserts the box responds to a command once the stream is done (i.e. setup actually completed).