-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cli: Use glint to determine if os.Stdout is tty #10926
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.
LGTM
command/deployment_status.go
Outdated
|
||
d.RenderFrame() |
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.
Silly question, but why is RenderFrame() getting called here--does it have to do with calculating the terminal size?
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.
Excellent question actually. It doesn't belong here! I added it for debugging to force the rendering in main thread rather than in a goroutine!
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Use glint to determine if os.Stdout is a terminal.
glint Terminal renderer expects os.Stdout not only to be a terminal, but also to have non-zero size. It's unclear how this condition arises, but this additional check causes Nomad to render deployments progress through glint when glint cannot support it.
By using golint to perform the check, we eliminate the risk of mis-judgement.
I opened mitchellh/go-glint#4 to fix the panic upstream: mitchellh/go-glint#4 . The upstream fix isn't sufficient for us, as it would just skip rendering deployments in this condition, instead of going the non-terminal rendering path in Nomad.
Fixes #10923