handle partial write in stdio forwarding (#41065)

Partial writes on the WSL stdio relay were ignored. This could result in loss of data. This PR adds the partial write handling logic.

Feng Wang committed Jul 14, 2026 at 11:27 UTC a3bdd01b40d151e0fbe375064476ea7ae321a33a
1 file changed +5
src/linux/init/init.cpp
+5
@@ -1840,6 +1840,11 @@ Return Value:
1840 break;
1841 }
1842 }
1843 + else if (BytesWritten < BytesRead)
1844 + {
1845 + assert(PendingStdin.empty());
1846 + PendingStdin.assign(Buffer.begin() + BytesWritten, Buffer.begin() + BytesRead);
1847 + }
1848 }
1849 }
1850