Skip to content

Detect if in pipe context without relying on isTTY #1

Description

@babakness

On the command line relying on the isTTY flag being set works fine but this technique fails when the script is called from a subprocess in another script. In this case, the process.stdin.isTTY is undefined.

An example situation is found in test scripts, where the input is not piped into the CLI yet because isTTY is undefined, it behaves as if data is piped in.

As such the --pipe option was added to manually tell the script when to look for piped data. Ideally, it can be automatic.

This needs to be investigated further.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions