Repository navigation
Conversation
| 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; | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yeah I was imagining isTTY, but passing on that for now seems fine.
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).