Skip to content

Add IO::PrefixSuffixBuffer for capturing truncated streams#16774

Open
straight-shoota wants to merge 4 commits intocrystal-lang:masterfrom
straight-shoota:feat/prefix-suffix-buffer
Open

Add IO::PrefixSuffixBuffer for capturing truncated streams#16774
straight-shoota wants to merge 4 commits intocrystal-lang:masterfrom
straight-shoota:feat/prefix-suffix-buffer

Conversation

@straight-shoota
Copy link
Copy Markdown
Member

Implements truncated error stream capture from RFC 0025.

Depends on #16773

straight-shoota added a commit that referenced this pull request Mar 28, 2026
Implement `Process.capture`, `Process.capture?` and `Process.capture_result` from [RFC 0025](crystal-lang/rfcs#25).

This implements the basic capture behaviour, which may be enhanced in the future.
In particular, this patch misses truncation of the captured error stream which will be a follow-up (#16774).
@straight-shoota straight-shoota force-pushed the feat/prefix-suffix-buffer branch from 228d526 to 8b6e8f2 Compare March 28, 2026 11:28
@straight-shoota straight-shoota marked this pull request as ready for review March 28, 2026 11:28
@straight-shoota
Copy link
Copy Markdown
Member Author

The failure on Windows is a bit suprising because the buffer implementation should be entirely identical across platforms. But the reason appears to be different chunking sizes when piping the stream on Windows. The failure reproduces on Linux with the same chunk sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants