termenv_other.go 770 B

123456789101112131415161718192021222324252627282930
  1. //go:build js || plan9 || aix
  2. // +build js plan9 aix
  3. package termenv
  4. import "io"
  5. // ColorProfile returns the supported color profile:
  6. // ANSI256
  7. func (o Output) ColorProfile() Profile {
  8. return ANSI256
  9. }
  10. func (o Output) foregroundColor() Color {
  11. // default gray
  12. return ANSIColor(7)
  13. }
  14. func (o Output) backgroundColor() Color {
  15. // default black
  16. return ANSIColor(0)
  17. }
  18. // EnableVirtualTerminalProcessing enables virtual terminal processing on
  19. // Windows for w and returns a function that restores w to its previous state.
  20. // On non-Windows platforms, or if w does not refer to a terminal, then it
  21. // returns a non-nil no-op function and no error.
  22. func EnableVirtualTerminalProcessing(w io.Writer) (func() error, error) {
  23. return func() error { return nil }, nil
  24. }