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

tput: No value for $TERM and no -T specified #13

Closed
styfle opened this issue Dec 13, 2019 · 3 comments · Fixed by #14
Closed

tput: No value for $TERM and no -T specified #13

styfle opened this issue Dec 13, 2019 · 3 comments · Fixed by #14

Comments

@styfle
Copy link
Contributor

styfle commented Dec 13, 2019

I'm seeing this error when process.env.TERM is undefined and process.stdout.isTTY is undefined.

tput: No value for $TERM and no -T specified

It happens on line 60 when tput cols is executed.

https://github.com/sindresorhus/term-size/blob/92aa07ee3a1cc28360af1c908f8a2ae10b6552bd/index.js#L60

@sindresorhus
Copy link
Owner

How are you seeing the error? Errors are silenced by the try/catch. Or do you mean you see it in the terminal as just printed output?

@styfle
Copy link
Contributor Author

styfle commented Dec 13, 2019

Its printed to stderr even though there is a try/catch.

You can reproduce if you deploy to ZEIT Now.

I added some console.log() prior to each line to determine exactly when it happens.

image

"there was an error" is the message I put in the catch

@styfle
Copy link
Contributor Author

styfle commented Dec 13, 2019

Here's the minimal steps to reproduce:

npm i -g now
git clone https://github.com/styfle/bug-term-size-tput
cd bug-term-size-tput
now

It will look like this: https://zeit.co/testing-internal/bug-term-size-tput/5howzk8xs

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 a pull request may close this issue.

2 participants