vcom/internal/config/session.go
vrubelroman 4ed81ef635 feat(state): atomic session in XDG_STATE_HOME; old UI saves theme via SetKey (2C.3)
state.Save writes session.toml atomically (0600, state dir 0700), drops
cursor-memory entries under cache/temp mounts and caps each pane at 200
entries; Load migrates the old ~/.config/vcom/session.toml once. The old
UI's session functions are aliases over state, and theme selection uses
config.SetKey, so the user's comments and keys survive. config.Save is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 23:37:23 +03:00

19 lines
648 B
Go

package config
import "vcom/internal/state"
// Session types and functions are thin aliases over internal/state, kept so
// the old UI compiles unchanged until stage 7.
type (
SessionState = state.Session
PaneSession = state.PaneSession
)
// DefaultSessionPath returns the session file ($XDG_STATE_HOME/vcom/session.toml).
func DefaultSessionPath() (string, error) { return state.File() }
// LoadSession reads the session (migrating it from the old location once).
func LoadSession() (SessionState, error) { return state.Load() }
// SaveSession writes the session atomically.
func SaveSession(s SessionState) error { return state.Save(s) }