Skip to content

site: output buffering & flushing#131

Merged
carloscortonc merged 3 commits intodevelopfrom
site/output-buffering
Jan 31, 2026
Merged

site: output buffering & flushing#131
carloscortonc merged 3 commits intodevelopfrom
site/output-buffering

Conversation

@carloscortonc
Copy link
Owner

Instead of sending output directly to renderer:

cli-er/site/src/main.js

Lines 30 to 32 in 9e9a2c1

const r = (...args) => renderer.renderOutput(...args);
process.stdout.write = (v) => r(v);
process.stderr.write = (v) => r(v, { error: true });


  • Send to corresponding "file-descriptors" (stdout=1, stderr=2), using convention /proc/xx/fd/{fd}
  • When output need to be rendered: flush it. Read the corresponding fd file, render it, and empty it
  • When output needs to be captured (inside quotes, pipe operator, etc): flush it without rendering it, and use the flushed value

@carloscortonc carloscortonc merged commit 595a765 into develop Jan 31, 2026
4 checks passed
@carloscortonc carloscortonc deleted the site/output-buffering branch January 31, 2026 08:38
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.

1 participant