-
Notifications
You must be signed in to change notification settings - Fork 141
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
Fix getting window size when there’s no TTY attached #812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but nothing that needs to block this
lib/utils/tty.coffee
Outdated
@@ -13,7 +13,8 @@ module.exports = (stream = process.stdout) -> | |||
updateWindowSize() | |||
|
|||
currentWindowSize = -> | |||
# always return a copy | |||
# always return a copy. | |||
# width/height can be null if no TTY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
, not null
lib/utils/compose.coffee
Outdated
@@ -619,7 +619,7 @@ class BuildProgressUI | |||
|
|||
_clear: -> | |||
@_tty.deleteToEnd() | |||
@_maxLineWidth = @_tty.currentWindowSize().width | |||
@_maxLineWidth = @_tty.currentWindowSize()?.width |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this currentWindowSize
is always defined still, it's just the width that might not be, and that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, that's was the whole point, to call currentWindowSize()
and be sure there's always width/height props, even if null/undefined.
Change-Type: patch
VersionBot failed to carry out a status check for the above pull request here: #812. The reason for this is: |
VersionBot failed to carry out a status check for the above pull request here: #812. The reason for this is: |
Change-Type: patch