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

Carry on even if there is no TERM environment variable set. #3305

Closed
wants to merge 1 commit into from

Conversation

SamirTalwar
Copy link
Contributor

@SamirTalwar SamirTalwar commented Jan 30, 2017

There are a few continuous integration systems which act as STDOUT is a
TTY, but don't set TERM. On those occasions, we get the following
error message:

Fatal error: exception Not_found

This, obviously, makes it pretty hard to figure out what the actual
problem is. An alternative implementation could throw a better error,
but it felt like defaulting to "dumb" was a reasonable solution here.

I couldn't see a reasonable place to put tests, so I omitted them. If there
is, please let me know.

There are a few continuous integration systems which act as STDOUT is a
TTY, but don't set `TERM`. On those occasions, we get the following
error message:

    Fatal error: exception Not_found

This, obviously, makes it pretty hard to figure out what the actual
problem is. An alternative implementation could throw a better error,
but it felt like defaulting to `"dumb"` was a reasonable solution here.
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@mroch
Copy link
Contributor

mroch commented Jan 31, 2017

nice catch, thanks!

there's a Sys_utils.getenv_term () function that we could use here but i don't think it'd look cleaner than this.

@facebook-github-bot
Copy link
Contributor

@gabelevi has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@SamirTalwar
Copy link
Contributor Author

Thanks for merging this, @mroch!

Incidentally, debugging this would have been much easier if the release version of Flow was compiled with debugging symbols. It doesn't move noticeably slower with them switched on in my experience. Is there a reason we couldn't have them turned on all the time?

facebook-github-bot pushed a commit that referenced this pull request Jan 31, 2017
Summary:
There are a few continuous integration systems which act as STDOUT is a
TTY, but don't set `TERM`. On those occasions, we get the following
error message:

    Fatal error: exception Not_found

This, obviously, makes it pretty hard to figure out what the actual
problem is. An alternative implementation could throw a better error,
but it felt like defaulting to `"dumb"` was a reasonable solution here.

I couldn't see a reasonable place to put tests, so I omitted them. If there
is, please let me know.
Closes #3305

Differential Revision: D4486056

Pulled By: mroch

fbshipit-source-id: 8c55b8eae407eed72f610ce9313745d150235046
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants