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

panic: Can't get terminal settings: inappropriate ioctl for device #91

Open
ixqbar opened this issue Dec 20, 2016 · 2 comments
Open

panic: Can't get terminal settings: inappropriate ioctl for device #91

ixqbar opened this issue Dec 20, 2016 · 2 comments

Comments

@ixqbar
Copy link

ixqbar commented Dec 20, 2016

go version go1.7.4 darwin/amd64
macos 10.12.1

use readme code

package main

import (
	"math/rand"
	"sync"
	"time"

	"gopkg.in/cheggaaa/pb.v1"
)

func main() {
	// create bars
	first := pb.New(200).Prefix("First ")
	second := pb.New(200).Prefix("Second ")
	third := pb.New(200).Prefix("Third ")
	// start pool
	pool, err := pb.StartPool(first, second, third)
	if err != nil {
		panic(err)
	}
	// update bars
	wg := new(sync.WaitGroup)
	for _, bar := range []*pb.ProgressBar{first, second, third} {
		wg.Add(1)
		go func(cb *pb.ProgressBar) {
			for n := 0; n < 200; n++ {
				cb.Increment()
				time.Sleep(time.Millisecond * time.Duration(rand.Intn(100)))
			}
			cb.Finish()
			wg.Done()
		}(bar)
	}
	wg.Wait()
	// close pool
	pool.Stop()
}
@malisit
Copy link
Contributor

malisit commented Mar 20, 2017

Works for macOS 10.12.3 & go version go1.7.5 darwin/amd64.

@nikolakn
Copy link

nikolakn commented May 2, 2019

I get this issue when running this example by the supervisor in Linux. If running it in console or redirect output to file it is working.

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

No branches or pull requests

3 participants