mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-13 01:21:38 -07:00
19 lines
425 B
Odin
19 lines
425 B
Odin
#+private
|
|
#+build linux, darwin, netbsd, openbsd, freebsd, haiku
|
|
package terminal
|
|
|
|
import "base:runtime"
|
|
import "core:os"
|
|
import "core:sys/posix"
|
|
|
|
_is_terminal :: proc "contextless" (handle: os.Handle) -> bool {
|
|
return bool(posix.isatty(posix.FD(handle)))
|
|
}
|
|
|
|
_init_terminal :: proc "contextless" () {
|
|
context = runtime.default_context()
|
|
color_depth = get_environment_color()
|
|
}
|
|
|
|
_fini_terminal :: proc "contextless" () { }
|