pb icon indicating copy to clipboard operation
pb copied to clipboard

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

Open ixqbar opened this issue 7 years ago • 2 comments

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()
}

ixqbar avatar Dec 20 '16 13:12 ixqbar

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

malisit avatar Mar 20 '17 01:03 malisit

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.

nikolakn avatar May 02 '19 14:05 nikolakn