Files
vikingowl bd41d76e32 refactor(tui): store pasted images in user cache, not project workdir
Ctrl+V image paste used to write the file to .gnoma/pasted_image_*.png
under the project root, which polluted the workdir and risked
committing screenshots that may contain sensitive content.

Now writes to os.UserCacheDir() / gnoma / pasted-images/ (XDG cache
on Linux, ~/Library/Caches on macOS, %LocalAppData% on Windows).
The directory is created at 0700 and files at 0600 since pasted
content can be sensitive.

Each paste prunes entries older than 2 hours best-effort, so the
cache doesn't accumulate across sessions. The 2h window safely
covers any single turn including provider retries and slow
subprocess CLIs that need the file to still exist on disk when
they ingest the path.

.gitignore: cover the legacy `.gnoma/pasted_image_*` location for
old checkouts; add log.txt and codex_out.jsonl which were tracked
as runtime artifacts during the recent work.

Tests cover cache-path placement, restrictive perms on both the
directory and the file, the no-pollution-of-cwd invariant, and the
prune behavior (stale removed, fresh kept, missing dir no-op).
2026-05-22 11:56:04 +02:00

47 lines
522 B
Plaintext

# Binaries
/gnoma
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test
*.test
*.out
coverage.html
coverage.txt
# Build
/bin/
/dist/
# IDE
.idea/
.vscode/
*.swp
*.swo
*~
# OS
.DS_Store
Thumbs.db
# Project config with secrets
.gnoma/config.toml
# Session data
.gnoma/sessions/
# Pasted-image artifacts. New images go to the user cache dir
# (~/.cache/gnoma/pasted-images/); the pattern covers legacy
# files written into .gnoma/ before that change.
.gnoma/pasted_image_*
# Debug
__debug_bin*
.env
.claude/
log.txt
codex_out.jsonl