This adds support for stdin redirect from file. For example
wc < somefile
as well as the existing
wc somefile
The WASM commands poll for a character at a time, so the solution here is to store the file contents and feed them to the command a character at a time. A more complicated solution will be required to read stdin from the terminal whilst a command is running (such as less) as the terminal is async. This might be a separate thread and polling perhaps.
This adds support for stdin redirect from file. For example
as well as the existing
The WASM commands poll for a character at a time, so the solution here is to store the file contents and feed them to the command a character at a time. A more complicated solution will be required to read stdin from the terminal whilst a command is running (such as
less
) as the terminal is async. This might be a separate thread and polling perhaps.