Skip to main content

Module shellintegration_prune

Module shellintegration_prune 

Source
Expand description

Removes the per-instance shell-integration folders (~/.agentmux/shell/<hash>) of instances that no longer exist.

integration_base_for keys a folder by a hash of the instance’s data dir, so every dev build, test home and old version leaves one behind (372 on one machine after two months). A hash can’t be reversed, so each folder records the data dir it belongs to in .instance; a folder is stale when that dir is gone. Age is never the test.

A folder from before the marker existed is matched against the instances still on disk and stamped, so it is cleaned up later once its dir goes away. One that matches nothing is left alone: its dir may live anywhere.

Structs§

PruneReport

Functions§

live_instance_data_dirs
The data dir of every instance ~/.agentmux knows of: installed versions and dev builds.
prune_stale_integration_dirs
Sweeps shell_root, keeping current_base and every folder whose instance still exists. live_data_dirs are the instance data dirs found on disk.
stamp_instance
Records which instance base belongs to. Called at deploy.