()
| 30 | ) |
| 31 | |
| 32 | func getTerminalWidth() int { |
| 33 | cmd := exec.Command("stty", "size") |
| 34 | cmd.Stdin = os.Stdin |
| 35 | out, err := cmd.Output() |
| 36 | if err != nil { |
| 37 | return 0 |
| 38 | } |
| 39 | dimensions := strings.Split(strings.TrimSpace(string(out)), " ") |
| 40 | if len(dimensions) != 2 { |
| 41 | return 0 |
| 42 | } |
| 43 | widthStr := dimensions[1] |
| 44 | width, ok := s.ParseInt(widthStr) |
| 45 | if !ok { |
| 46 | return 0 |
| 47 | } |
| 48 | return width |
| 49 | } |
| 50 | |
| 51 | func watchHeader() string { |
| 52 | timeStr := libtime.LocalHourNow() |
no outgoing calls
no test coverage detected