emscripten-core / emscripten-core/emscripten
WASMFS hard-codes stdin, stdout, stderr behavior
Open
- 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
Assessment
This issue has not been assessed yet.