khenaidoo | 59ce9dd | 2019-11-11 13:05:32 -0500 | [diff] [blame] | 1 | // +build !appengine,!js,windows |
2 | |||||
3 | package logrus | ||||
4 | |||||
5 | import ( | ||||
6 | "io" | ||||
7 | "os" | ||||
8 | "syscall" | ||||
9 | |||||
10 | sequences "github.com/konsorten/go-windows-terminal-sequences" | ||||
11 | ) | ||||
12 | |||||
13 | func initTerminal(w io.Writer) { | ||||
14 | switch v := w.(type) { | ||||
15 | case *os.File: | ||||
16 | sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) | ||||
17 | } | ||||
18 | } |