sys: interactive run; yaml: multiline round-trip and error return #61

Closed
opened 2026-10-13 05:48:08 +02:00 by michael · 1 comment
Owner

Context

Found while building question catalogs in fragjan (DAW/fragjan#136).
Checked against 1.2.0 (d74cc1c), the version fragjan pins.

Findings

  1. sys has no way to run an interactive program. run() and
    run_rc() use io.popen and capture output, so an editor
    ($EDITOR, e.g. helix) gets no terminal.
  2. yaml.dump() writes multiline strings as "...\n...", but
    yaml.load() does not unescape \n -- round-trip changes the text.
  3. yaml.load() throws via error() on block scalars (|) instead of
    returning nil, err.

Proposal

  • sys:run_interactive(cmd) -- TTY passthrough via os.execute,
    returns exit code
  • Multiline strings round-trip through dump() / load()
    (escape handling or block scalars)
  • load() returns nil, err for unsupported syntax

Notes

Target the new common (2.x), not 1.2.0. Please check whether 2.1.1
already covers any of this.

## Context Found while building question catalogs in fragjan (DAW/fragjan#136). Checked against 1.2.0 (`d74cc1c`), the version fragjan pins. ## Findings 1. `sys` has no way to run an interactive program. `run()` and `run_rc()` use `io.popen` and capture output, so an editor (`$EDITOR`, e.g. helix) gets no terminal. 2. `yaml.dump()` writes multiline strings as `"...\n..."`, but `yaml.load()` does not unescape `\n` -- round-trip changes the text. 3. `yaml.load()` throws via `error()` on block scalars (`|`) instead of returning `nil, err`. ## Proposal - [ ] `sys:run_interactive(cmd)` -- TTY passthrough via `os.execute`, returns exit code - [ ] Multiline strings round-trip through `dump()` / `load()` (escape handling or block scalars) - [ ] `load()` returns `nil, err` for unsupported syntax ## Notes Target the new common (2.x), not 1.2.0. Please check whether 2.1.1 already covers any of this.
Author
Owner

time: fragjan catalogs need partial timestamps for hand-written YAML: YYYY-MM-DD, YYYY-MM-DD HH:MM[:SS], optional Z/+HH:MM. 2.1.1 validates ranges but only full ISO 8601. 1.2.0 normalises invalid values silently via os.time (29:99 -> next day). fragjan validates locally in core/validator/util.lua until migration.

time: fragjan catalogs need partial timestamps for hand-written YAML: YYYY-MM-DD, YYYY-MM-DD HH:MM[:SS], optional Z/+HH:MM. 2.1.1 validates ranges but only full ISO 8601. 1.2.0 normalises invalid values silently via os.time (29:99 -> next day). fragjan validates locally in core/validator/util.lua until migration.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-lua-common#61
No description provided.