webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

Writing to the stdin of a process launched with WebContainerInstance.spawn converts \r\n to \n\n

Open paoloricciuti opened this issue 4 months ago • 5 comments

Describe the bug

Kind of a niche one but i was trying to integrate sveltelab with the svelte language server (which use the vscode-json-rpc under the hood.

To trigger the language server i need to write the header followed by \r\n\r\n followed by the actual rpc message.

It was not working so i started modifying the node modules of vscode-json-rpc inside the webcontainer to get some log and i realized that whenever i wrote \r\n to the stdin what the process actually received was \n\n.

I don't know how to properly create a reproduction for this. 😶

Link to the blitz that caused the error

not a problem with stackblitz itself, but with @webcontainers/api

Steps to reproduce

As i've said i don't really know how to create a usable reproduction for this since it was me messing around with the node modules inside a webcontainer instance.

Expected behavior

\r\n should be sent as \r\n

Parity with Local

Screenshots

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

paoloricciuti avatar Feb 22 '24 17:02 paoloricciuti