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>
19 lines
648 B
Go
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) }
|