Skip to content

Require stopping a box before it can be deleted - #218

Open
kacperpaczos wants to merge 3 commits into
Dvlv:masterfrom
kacperpaczos:feat/gate-actions-on-state
Open

Require stopping a box before it can be deleted#218
kacperpaczos wants to merge 3 commits into
Dvlv:masterfrom
kacperpaczos:feat/gate-actions-on-state

Conversation

@kacperpaczos

@kacperpaczos kacperpaczos commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Deleting a box runs distrobox rm --force, which will tear the container down even while it is running — and with it whatever is working inside. That felt too easy to do by accident, so this makes you stop the box first.

While the box is up, the Delete Box row is greyed out; the Stop button already sits on the header for a running box, and once the box is stopped the row enables itself again. The row keeps its place and its height in both states, so nothing on the page shifts when the box starts or stops.

It is one set_sensitive(!dbox.is_running) on the row; I confirmed the greyed-out row on a running box and the live one on a stopped box on a virtual display with a stub distrobox list.

Delete Box removes the container with --force, so it would happily tear down
a box that is still running and whatever is working inside it. Disable the
Delete row while the box is up, with a subtitle pointing at the Stop button
that is already on the header, and enable it again once the box is down.
A one-line predicate and its tests said nothing the condition itself
does not; the row is now gated directly on dbox.is_running.
The note under the row made it taller only while the box was running,
so the list shifted on Start and Stop; the greyed-out row is clear
enough by itself.
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