Просмотр исходного кода

console: fix windows color transformation issue

Péter Szilágyi 9 лет назад
Родитель
Сommit
d251d48439
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      console/console.go

+ 2 - 1
console/console.go

@@ -30,6 +30,7 @@ import (
 	"github.com/ethereum/go-ethereum/internal/jsre"
 	"github.com/ethereum/go-ethereum/internal/web3ext"
 	"github.com/ethereum/go-ethereum/rpc"
+	"github.com/mattn/go-colorable"
 	"github.com/peterh/liner"
 	"github.com/robertkrimen/otto"
 )
@@ -80,7 +81,7 @@ func New(config Config) (*Console, error) {
 		config.Prompt = DefaultPrompt
 	}
 	if config.Printer == nil {
-		config.Printer = os.Stdout
+		config.Printer = colorable.NewColorableStdout()
 	}
 	// Initialize the console and return
 	console := &Console{