TerminalWidth returns the width of the terminal that controls the process
()
| 411 | |
| 412 | // TerminalWidth returns the width of the terminal that controls the process |
| 413 | func (s *IOStreams) TerminalWidth() int { |
| 414 | w, _, err := s.term.Size() |
| 415 | if err == nil && w > 0 { |
| 416 | return w |
| 417 | } |
| 418 | return DefaultWidth |
| 419 | } |
| 420 | |
| 421 | func (s *IOStreams) ColorScheme() *ColorScheme { |
| 422 | return &ColorScheme{ |