Fixed wrong handling of 8-bit ANSI colors. Fixes #317

This commit is contained in:
Oliver 2019-07-11 11:30:32 +01:00
parent fc28d646d0
commit 0e689965bb
2 changed files with 3 additions and 1 deletions

View File

@ -127,6 +127,7 @@ func (a *ansi) Write(text []byte) (int, error) {
"#ffffff",
}[colorNumber]
}
FieldLoop:
for index, field := range fields {
switch field {
case "1", "01":
@ -185,6 +186,7 @@ func (a *ansi) Write(text []byte) (int, error) {
background = color
}
}
break FieldLoop
}
}
if len(attributes) > 0 || clearAttributes {

View File

@ -81,7 +81,7 @@ func NewApplication() *Application {
//
// Note that this also affects the default event handling of the application
// itself: Such a handler can intercept the Ctrl-C event which closes the
// applicatoon.
// application.
func (a *Application) SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *Application {
a.inputCapture = capture
return a