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

Update bubbletea package. Reenable TTY detection #193

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

preslavgerchev
Copy link
Contributor

Fixes #167

@@ -62,7 +62,7 @@ func NewMultiBar(id string, data progressData) *progressbar {
id: id,
maxNameWidth: maxNameWidth,
Data: data,
isTTY: isatty.IsTerminal(os.Stdout.Fd()) && false, // FIXME: re-enable the detection
isTTY: isatty.IsTerminal(os.Stdout.Fd()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still support piping args into cnspec? If not, maybe we can remove some code here (lines 84-96):

// else if not a TTY (but piped?)
else {
		go func() {
			for {
				time.Sleep(time.Second / progressPipedFps)
				if p.Data.complete {
					break
				}
				fmt.Print(p.View() + "\r\033[2A")
			}
			fmt.Print(p.View())
		}()
	}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, lets revisit that if we can simplify the approach here

@chris-rock chris-rock force-pushed the preslav/consistent-progress-bar branch from 454d2ce to 54e13c7 Compare November 15, 2022 22:35
@chris-rock
Copy link
Member

rebased on #192

@@ -62,7 +62,7 @@ func NewMultiBar(id string, data progressData) *progressbar {
id: id,
maxNameWidth: maxNameWidth,
Data: data,
isTTY: isatty.IsTerminal(os.Stdout.Fd()) && false, // FIXME: re-enable the detection
isTTY: isatty.IsTerminal(os.Stdout.Fd()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, lets revisit that if we can simplify the approach here

Signed-off-by: Preslav <preslav@mondoo.com>
@chris-rock chris-rock force-pushed the preslav/consistent-progress-bar branch from 54e13c7 to 885bd5b Compare November 15, 2022 23:02
@vjeffrey vjeffrey merged commit feccc9b into main Nov 16, 2022
@vjeffrey vjeffrey deleted the preslav/consistent-progress-bar branch November 16, 2022 00:15
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Progress bars not displayed correctly
3 participants