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

feat: add an isTTY check #3

Merged
merged 1 commit into from
May 17, 2016
Merged

feat: add an isTTY check #3

merged 1 commit into from
May 17, 2016

Conversation

Fishrock123
Copy link
Contributor

This prevents the code from having a negative impact on piped stdio.

Refs: nodejs/node#6456 (comment)
Refs: nodejs/node#1771 (comment)

@bcoe

@Fishrock123 Fishrock123 deleted the isTTY branch May 17, 2016 15:21
@Fishrock123 Fishrock123 restored the isTTY branch May 17, 2016 15:21
@Fishrock123 Fishrock123 reopened this May 17, 2016
@coveralls
Copy link

coveralls commented May 17, 2016

Coverage Status

Coverage decreased (-25.0%) to 75.0% when pulling 50944ba on Fishrock123:isTTY into 7d0c45e on yargs:master.

@Fishrock123
Copy link
Contributor Author

Uhhhh

idk how to actually test this against a TTY so I'm just gona fake it I guess.

This prevents the code from having a negative impact on piped stdio.

Refs: nodejs/node#6456 (comment)
Refs: nodejs/node#1771 (comment)
@Fishrock123
Copy link
Contributor Author

@bcoe lmk if it needs a better test. I can't think of one off-hand though that won't break once we patch the issue.

@coveralls
Copy link

coveralls commented May 17, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling b7193b3 on Fishrock123:isTTY into 7d0c45e on yargs:master.

@bcoe
Copy link
Member

bcoe commented May 17, 2016

@Fishrock123 is there a way for us to differentiate between spawn/exec's default pipe behavior, and an application being executed with |?

@bcoe
Copy link
Member

bcoe commented May 17, 2016

@Fishrock123 as an alternative option, perhaps document how yargs uses this module in the README, as a "Word of Warning":

hold off logging until the last moment, and set blocking to true only once you know you're about to exit.

@Fishrock123
Copy link
Contributor Author

Fishrock123 commented May 17, 2016

is there a way for us to differentiate between spawn/exec's default pipe behavior, and an application being executed with |?

No, it's literally the same as far as I know.

Maybe if we tweak the stdio settings? But I doubt any of that helps because then there's no way of checking it.. :/ https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio

as an alternative option, perhaps document how yargs uses this module in the README, as a "Word of Warning":

I mean we should probably have that too..

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