emscripten-core / emscripten-core/emscripten

WASMFS hard-codes stdin, stdout, stderr behavior

Open
#23,724 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

In the JS FS, it's possible to use `FS.init(stdin, stdout, stderr)` or `Module['stdin']` (&c) to customize the standard file handle behaviors. WASMFS does define `/dev/stdout` (and so on), but hard-codes their behavior to `emscripten_out`, `emscripten_err`, and reading a string from a browser prompt (`FS_stdin_getChar`). stdout and stderr are also always buffered.

Instead, they should use `Module['stdin']`, `Module['stdout']`, and `Module['stderr']` if defined, or some other mechanism should be used so a caller can wrap a process's input/output.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.