Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore stderr on spawned processes #19

Merged
merged 2 commits into from
Oct 7, 2021

Conversation

ianobermiller
Copy link
Contributor

When using term-info on a non-interactive terminal (like in CI or a pre-commit hook in Sublime Merge), resize and tput write out to stderr:

Opening `/dev/tty` failed (6): Device not configured
resize:  can't open terminal /dev/tty
tput: No value for $TERM and no -T specified

We can suppress these by passing 'ignore' for the third tuple value of stdio, which corresponds to stderr.

When using term-info on a non-interactive terminal (like in CI or a pre-commit hook in Sublime Merge), resize and tput write out to stderr:

```
Opening `/dev/tty` failed (6): Device not configured
resize:  can't open terminal /dev/tty
tput: No value for $TERM and no -T specified
```

We can suppress these by passing `'ignore'` for the third tuple value of `stdio`, which corresponds to `stderr`.
@sindresorhus
Copy link
Owner

stderr by default will be output to the parent process' stderr unless stdio is specified.

That gets me every time. Such a weird behavior.

index.js Outdated Show resolved Hide resolved
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
@ianobermiller
Copy link
Contributor Author

That gets me every time. Such a weird behavior.

Yup. Doesn't help that commands aren't always consistent about how they use stdout and stderr.

@sindresorhus sindresorhus merged commit 62297b0 into sindresorhus:main Oct 7, 2021
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.

None yet

2 participants