[WSLC] Allow commands to receive input
Description of the task
Via WslcGetProcessIOHandle (https://wsl.dev/api-reference/c/process-apis/wslcgetprocessiohandle/)
&
typedef enum WslcProcessIOHandle
{
WSLC_PROCESS_IO_HANDLE_STDIN = 0,
WSLC_PROCESS_IO_HANDLE_STDOUT = 1,
WSLC_PROCESS_IO_HANDLE_STDERR = 2
} WslcProcessIOHandle;
https://wsl.dev/api-reference/c/enumerations/wslcprocessiohandle/
Additional context
No response
Release tracking
Allow programs in WSLC to receive input from a file, pipe, or SDK, both when starting a new container and when running a command in an existing container. Reopened to track this unfinished implementation rather than create a duplicate issue. The SDK prerequisite is no longer blocked.
- [x] Update the WSLc SDK prerequisite: #1550.
- [ ] Send input to commands in existing containers: #1562.
- [ ] Send input when starting a new container: #1564.
Keep this issue open until both input-forwarding PRs are merged. #1562 is part of the work; the final PR, #1564, closes the issue.
I was already tracking this in ADO and this is blocked on WSLC SDK. Context below:
WslcGetProcessIOHandle(WSLC_PROCESS_IO_HANDLE_STDIN) returns E_INVALIDARG. CreateRelayedProcessIO creates and relays a stdin pipe, but only when WSLCProcessFlagsStdin is set (otherwise it closes stdin outright), and wslc exec -i sets it, which is why the CLI has working stdin and we don't.
The gap looks confined to the SDK layer: CopyProcessSettingsToRuntime leaves WSLCProcessOptions::Flags unset under a // TODO: No user access, and WslcProcessSettings exposes no setter for it, so no SDK caller can reach stdin.
Reached out to WSLC SDK team- https://github.com/microsoft/WSL/issues/41695
Tracked in ADO