mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 11:09:17 -07:00
Simplify how we enable ANSI colors on Windows
This commit is contained in:
1
tty.go
1
tty.go
@@ -20,7 +20,6 @@ func (p *Program) initTerminal() error {
|
||||
}
|
||||
|
||||
if p.outputIsTTY {
|
||||
enableAnsiColors(p.output)
|
||||
hideCursor(p.output)
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
package tea
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/containerd/console"
|
||||
@@ -40,7 +39,3 @@ func openInputTTY() (*os.File, error) {
|
||||
}
|
||||
return f, nil
|
||||
}
|
||||
|
||||
// enableAnsiColors is only needed for Windows, so for other systems this is
|
||||
// a no-op.
|
||||
func enableAnsiColors(_ io.Writer) {}
|
||||
|
||||
@@ -34,6 +34,8 @@ func (p *Program) initInput() error {
|
||||
c := console.Current()
|
||||
p.console = c
|
||||
|
||||
enableAnsiColors(p.output)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user