Repository navigation
Conversation
Co-authored-by: AnPod <AnPod@users.noreply.github.com>
200ee06 to
bf467d4
Compare
The by-pid targets are compared after readlink -f, but the by-id paths were globbed from XDG_RUNTIME_DIR as given, so a trailing slash or a symlinked runtime dir made the live instance look unreferenced and deleted its lock and IPC socket. Resolve the runtime dir once so both sides compare in the same form. The test now runs with a trailing slash, and checks the dead by-pid link with -L, since -e is already false for a link whose target was pruned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed and tested on a disposable Omarchy VM running a real Hyprland session, with the shell loaded from this branch. Reproduction. On Pushed a fix (8e9d02d). The helper compared each live Second opinion: Codex Medium reviewed this in two rounds. The first round found the path mismatch and the weak For the maintainer: this PR says it fixes #13287, so merging it will close that issue. It clears out the logs of dead instances, which is what the original report describes. A later comment on #13287 describes a single live instance's |
|
|
|
||
| # Drop dead Quickshell instance dirs before a new one starts writing. Stale | ||
| # by-id logs otherwise grow without bound on the user runtime tmpfs. | ||
| omarchy-quickshell-prune-logs >/dev/null 2>&1 || true |
There was a problem hiding this comment.
Crash relaunches skip pruning When Quickshell crashes and this launcher starts it again, execution returns to the loop below, not to this prune call. Each crashed instance can leave another log directory behind until a separate launcher process starts, so logs can keep accumulating during repeated relaunches.
| for dir in "$by_id"/*; do | ||
| [[ -d $dir ]] || continue | ||
| if [[ -n ${keep[$dir]+x} ]]; then | ||
| continue | ||
| fi | ||
| rm -rf -- "$dir" |
There was a problem hiding this comment.
Redirected directory risks data loss If
by-id is a symlink to another directory, the earlier -d check accepts it and this glob visits the destination’s children. The prune can then recursively delete directories unrelated to Quickshell instead of only instance logs. Constrain by-id to the intended runtime directory before removing its children.
| pid=${link##*/} | ||
| [[ $pid =~ ^[0-9]+$ ]] || continue | ||
|
|
||
| if ! kill -0 "$pid" 2>/dev/null; then |
There was a problem hiding this comment.
Reused PIDs retain old logs If an unrelated process takes over the PID of a dead Quickshell instance,
kill -0 succeeds and the old directory enters the keep set. It will remain on subsequent prunes while that process lives, reducing the effectiveness of the log cleanup. Check that the PID still belongs to the instance, rather than checking only that it exists.
| sleep 120 & | ||
| live_pid=$! |
There was a problem hiding this comment.
Summary
Fixes #13287
Quickshell accumulated per-instance log dirs under
/run/user/$UIDuntil tmpfs filled, breaking app launches.Change
Test plan
$XDG_RUNTIME_DIRshould not fill with old quickshell log dirs