Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Apr 8, 2022

We don't have TTY support in emscripten anyhow, so most of this just
does nothing. We also do not yet have a concept of TTYs in wasmfs,
so just recognize stdin/out/err as such. This is enough for basic things,
gets some tests passing, and is almost at parity with the old FS (it had
the ability to create new terminals and mark them as such).

@kripken kripken requested a review from tlively April 8, 2022 13:30
@kripken kripken mentioned this pull request Apr 8, 2022
Comment on lines 1115 to 1119
static bool isTTY(int fd) {
// TODO: Full TTY support. For now, just see stdin/out/err as terminals and
// nothing else.
return fd == STDIN_FILENO || fd == STDOUT_FILENO || fd == STDERR_FILENO;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we at least check for File equality with /dev/stdin, etc? That will be more robust against the standard streams being moved or reassigned, etc. Even better would be to add a virtual method to File and have our stream implementations override it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea to check for equality on the singleton objects, done.

We could add a virtual method to File, but I'm not sure what it should look like - "isTTY"? Or should it be more general and represent all types of special devices? As our earliest adopters of WasmFS won't be using TTY support, I think it's best to defer work on that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was imagining isTTY, but passing on that for now seems fine.

@kripken kripken enabled auto-merge (squash) April 11, 2022 19:45
@kripken kripken merged commit d26e762 into main Apr 11, 2022
@kripken kripken deleted the wfioctl branch April 11, 2022 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants