[v0.1/P1] Resolve pipe file targets relative to config.toml #335
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#335
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The config design states that file-valued keys resolve relative to
config.toml, not the process working directory, because GUI launches commonly have an arbitrary cwd. The keymappipefile sink is the exception: its string is carried unchanged intowrite_region_file, so a relative path resolves against the client process cwd.This is both surprising and unstable:
Proposed resolution
Resolve
target = { file = "..." }at config-load time using the same source-directory and~/rules as other file-valued config. Carry the resolved path in the runtime action rather than retaining a cwd-sensitive string.If a config source has no directory, define one explicit fallback rather than inheriting whatever cwd the write happens to observe.
Command argv remains separate: executable/path resolution inside
target = { command = [...] }follows normal client process execution rules and is not a file-valued config key.Acceptance criteria
~/and absolute paths behave consistently with other file-valued keys.Evidence
crates/felis-client-core/src/keymap/map.rs(PipeSink::File)crates/felis-client-core/src/config.rs(resolve_path)crates/felis-client/src/app_methods.rs(finish_pipe)docs/reference/keybindings.mddocs/explanation/architecture/control-surfaces.mdRelated: #8, #326.
Decision: do, as a documented behavior change aligned to the recorded rule (reviewed)
PipeSink::Fileis carried unchanged intoPipeTarget::File(Some(path))and reacheswrite_region_filewithout passingresolve_path.control-surfaces.mdrecords "file-valued keys resolve againstconfig.toml, not the process's working directory", butkeybindings.mdcurrently documents the pipe path as verbatim, cwd-relative, no~/, so the reference contradicts the explanation and this is aCHANGELOG.mdentry, not a silent fix.Resolution: resolve at config load with the same
resolve_path(name, base_dir)thatshader.postuses, so~/and absolute paths behave like every other file-valued key. No new fallback is invented: every production document is read from a path and has a parent, missing discovery yieldsEffectiveConfig::default()with no file key at all, and only a programmatic parse-from-text hassource_dir = None, where relative paths resolve against the working directory asEffectiveConfig::source_diralready documents. (There is no--config -or embedded source.) Tests load from a different cwd and check the destination;keybindings.mdand the control-surfaces explanation are updated together.