Skip to content

fix(session): support symlinked config directories - #361

Merged
fcoury merged 1 commit into
mainfrom
fcoury/config-symlink
Sep 5, 2026
Merged

fix(session): support symlinked config directories#361
fcoury merged 1 commit into
mainfrom
fcoury/config-symlink

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Why

A symlinked ~/.config/red can load configuration, but session snapshots fail to save because the snapshot store rejects symlinked path components. This leaves users with dotfile-managed config directories without session recovery data.

What

Resolve the configured directory to its physical path before selecting the sessions root at editor startup. Both snapshot writes and --resume use that path. The snapshot store still rejects symlinks within sessions and its owner directories, as enforced by its directory traversal.

How to Test

  1. In a disposable home or XDG config directory, symlink red to a writable config directory, then launch red and exit normally. Confirm sessions/editor-*/latest.json appears in the target directory without a snapshot failure warning.
  2. Launch red --resume with the same config path and confirm it loads the saved session.
  3. In a separate disposable config directory, make sessions itself a symlink. Confirm Red still rejects that session root.

Targeted test passed: cargo test --bin red session_root_resolves_a_symlinked_config_directory.

@fcoury
fcoury merged commit b57dccf into main Sep 5, 2026
12 checks passed
@fcoury
fcoury deleted the fcoury/config-symlink branch September 5, 2026 23:18
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.

2 participants