packer: don't change background color in UI

This commit is contained in:
Mitchell Hashimoto 2013-11-19 21:31:54 -08:00
parent ef5448d4dd
commit c7d7e2cf0f
3 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,9 @@
## 0.4.1 (unreleased)
BUG FIXES:
* core: Don't change background color on CLI anymore, making things look
a tad nicer in some terminals.
## 0.4.0 (November 19, 2013)

View File

@ -106,7 +106,7 @@ func (u *ColoredUi) colorize(message string, color UiColor, bold bool) string {
attr = 1
}
return fmt.Sprintf("\033[%d;%d;40m%s\033[0m", attr, color, message)
return fmt.Sprintf("\033[%d;%dm%s\033[0m", attr, color, message)
}
func (u *ColoredUi) supportsColors() bool {

View File

@ -19,19 +19,19 @@ func TestColoredUi(t *testing.T) {
ui.Say("foo")
result := readWriter(bufferUi)
if result != "\033[1;33;40mfoo\033[0m\n" {
if result != "\033[1;33mfoo\033[0m\n" {
t.Fatalf("invalid output: %s", result)
}
ui.Message("foo")
result = readWriter(bufferUi)
if result != "\033[0;33;40mfoo\033[0m\n" {
if result != "\033[0;33mfoo\033[0m\n" {
t.Fatalf("invalid output: %s", result)
}
ui.Error("foo")
result = readWriter(bufferUi)
if result != "\033[1;31;40mfoo\033[0m\n" {
if result != "\033[1;31mfoo\033[0m\n" {
t.Fatalf("invalid output: %s", result)
}
}