terminal_posix.odin 425 B

123456789101112131415161718
  1. #+private
  2. #+build linux, darwin, netbsd, openbsd, freebsd, haiku
  3. package terminal
  4. import "base:runtime"
  5. import "core:os"
  6. import "core:sys/posix"
  7. _is_terminal :: proc "contextless" (handle: os.Handle) -> bool {
  8. return bool(posix.isatty(posix.FD(handle)))
  9. }
  10. _init_terminal :: proc "contextless" () {
  11. context = runtime.default_context()
  12. color_depth = get_environment_color()
  13. }
  14. _fini_terminal :: proc "contextless" () { }