diff --git a/exp/term/ansi/doc.go b/exp/term/ansi/doc.go index 7b889098..66ae7395 100644 --- a/exp/term/ansi/doc.go +++ b/exp/term/ansi/doc.go @@ -1,4 +1,5 @@ -// This package defines common ANSI escape sequences. +// This package defines common ANSI escape sequences based on the ECMA-48 +// specs. // // All sequences use 7-bit C1 control codes, which are supported by most // terminal emulators. Osc sequences are terminated by a BEL for wider diff --git a/exp/term/ansi/style/style.go b/exp/term/ansi/style/style.go index 3c478ad4..e943373f 100644 --- a/exp/term/ansi/style/style.go +++ b/exp/term/ansi/style/style.go @@ -52,7 +52,7 @@ func Sequence(attrs ...Attribute) string { } // Foreground returns the SGR attribute for the given foreground color. -func ForegrondColor(c Color) Attribute { +func ForegroundColor(c Color) Attribute { switch c := c.(type) { case BasicColor: // 3-bit or 4-bit ANSI foreground diff --git a/exp/term/ansi/style/style_test.go b/exp/term/ansi/style/style_test.go index 5beb2658..0cbd9678 100644 --- a/exp/term/ansi/style/style_test.go +++ b/exp/term/ansi/style/style_test.go @@ -28,8 +28,8 @@ func TestSequence(t *testing.T) { if style.Sequence( style.Bold, style.Underline, - style.ForegrondColor(style.ExtendedColor(255)), + style.ForegroundColor(style.ExtendedColor(255)), ) != "\x1b[1;4;38;5;255m" { - t.Errorf("Unexpected sequence: %s", style.Sequence(style.Bold, style.Underline, style.ForegrondColor(style.ExtendedColor(255)))) + t.Errorf("Unexpected sequence: %s", style.Sequence(style.Bold, style.Underline, style.ForegroundColor(style.ExtendedColor(255)))) } }