Skip to content

Move stdout and stderr line buffering responsibility to shell.html #5290

Open
@juj

Description

@juj

Something I've been thinking of doing for quite a while - currently we expect that stdout and stderr streams are line buffered (e.g. like console.log() is) by requirement, and for example on fflush() we can only flush full lines. However different environments have support for different granularities. For example:

  • we can flush individual characters when printing to a text box on a web page, so that does not need to depend on line buffering
  • when one is using window.dump() to debug, then we would be able to support char buffering
  • when one is using emrun debug harness, then we can support char buffering
  • when one is using a shell like node.js or SpiderMonkey, then we can also do char buffering

It would make sense to remove the abstractions for line buffering and rebuild them in the default shell.html file instead. That would allow a clean way to fix #2770.

The only drawback is for people who use a custom shell file, if behavior changed on them to suddenly buffer chars instead of lines, then they would see incorrectly split console.log() prints. Therefore the feature would perhaps need to be an option that one opts in to.

Any objections?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions