Matteo Scandolo | 1f49bf5 | 2018-11-20 13:56:45 -0800 | [diff] [blame] | 1 | // +build !appengine,!js,windows |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 2 | |
| 3 | package logrus |
| 4 | |
| 5 | import ( |
Matteo Scandolo | 1f49bf5 | 2018-11-20 13:56:45 -0800 | [diff] [blame] | 6 | "io" |
| 7 | "os" |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 8 | "syscall" |
Matteo Scandolo | 1f49bf5 | 2018-11-20 13:56:45 -0800 | [diff] [blame] | 9 | |
| 10 | sequences "github.com/konsorten/go-windows-terminal-sequences" |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 11 | ) |
| 12 | |
Matteo Scandolo | 1f49bf5 | 2018-11-20 13:56:45 -0800 | [diff] [blame] | 13 | func initTerminal(w io.Writer) { |
| 14 | switch v := w.(type) { |
| 15 | case *os.File: |
| 16 | sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) |
| 17 | } |
Jonathan Hart | f86817b | 2018-08-17 10:35:54 -0700 | [diff] [blame] | 18 | } |