You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Every invocation leaks a 3.6MB dylib into tmpdir #556
Each run of hunk extracts its embedded libopentui.dylib into $TMPDIR as a hidden file named .{hash}-00000000.dylib (3.6MB). The file gets a unique random name on every run and is never deleted, even when hunk exits cleanly.
This adds up fast when hunk is used as a git pager. With lazygit spawning git diff | hunk pager on every refresh, my machine accumulated 81,653 of these files (about 190GB) in three weeks, at a rate of roughly 18 files per minute while lazygit was open (which I often leave open in a cmux pane, one per workspace).
This looks like Bun's single-file executable behaviour: embedded native addons are extracted to TMPDIR at startup, and the randomized filename prevents reuse across runs. Since cleanup doesn't happen either, every invocation adds a new copy.
Reproduced on v0.17.0 (Homebrew) and v0.17.1 (release binary hunkdiff-darwin-arm64), macOS 15 (Darwin 24.6.0), Apple Silicon.
For anyone hitting this before the Bun-side fix (oven-sh/bun#29587) lands: proposed an interim startup sweep that reaps hunk's stale leaked artifacts in #568. On Linux this leak filled a 16 GB tmpfs overnight with an agent polling hunk session every 2 s.
Confirmed still reproducible on v0.17.2 (Homebrew), macOS 26.5.2 (25F84), arm64.
We found 16,093 leaked libopentui.dylib copies under the per-user macOS TMPDIR, consuming about 52 GiB. The trigger was repeated Hunk pager invocations from long-running LazyGit sessions.
I upgraded from v0.17.0 to v0.17.2 and ran the isolated five-invocation repro. Result:
5 invocations
5 new dylibs
each 3,758,912 bytes
18 MiB total
The test used an isolated TMPDIR and cleaned it afterward. Thus v0.17.2 still leaks one dylib per invocation. Please consider reopening this issue until #568, or an equivalent fix, is merged and released.
Activity
franky47 commentedon Jul 17, 2026
This is an upstream issue in Bun:
OpenTUI
WakaTaira commentedon Jul 18, 2026
For anyone hitting this before the Bun-side fix (oven-sh/bun#29587) lands: proposed an interim startup sweep that reaps hunk's stale leaked artifacts in #568. On Linux this leak filled a 16 GB tmpfs overnight with an agent polling
hunk sessionevery 2 s.snirt commentedon Jul 19, 2026
Confirmed still reproducible on v0.17.2 (Homebrew), macOS 26.5.2 (25F84), arm64.
We found 16,093 leaked libopentui.dylib copies under the per-user macOS TMPDIR, consuming about 52 GiB. The trigger was repeated Hunk pager invocations from long-running LazyGit sessions.
I upgraded from v0.17.0 to v0.17.2 and ran the isolated five-invocation repro. Result:
The test used an isolated TMPDIR and cleaned it afterward. Thus v0.17.2 still leaks one dylib per invocation. Please consider reopening this issue until #568, or an equivalent fix, is merged and released.
tolgaerdonmez commentedon Jul 20, 2026
This generated 650GB of tmp files in my system too.
benvinegar commentedon Jul 26, 2026
Okay #590 should make a huge difference. It's in 0.17.6.
fix(cli): sweep stale Bun-extracted temp libraries at startup