Skip to content

The isTTY check prevents showing colors when piping spawn output with child_process #94

@vjpr

Description

@vjpr

Say I writing a cli task runner that runs node processes with spawn. If I want to pipe the output to the stdout (so I can intercept the data and process if necessary), tty will not be set. And then you have to do some complicated stuff with drawback like native deps (https://stackoverflow.com/questions/31866207/spawning-a-child-process-with-tty-in-node-js) to emulate a tty (or maybe there is an easier way).

So isTTY doesn't seem like is prevents supporting colors. Or is this the only way to detect cat file | node app or something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions