v0.2.0 16 colors, default colors, /dev/tty, bracketed paste, themed form controls

This commit is contained in:
lixen committed 2026-10-09 14:15:46 -04:00
1 parent 070131c7fd
commit 2b5d127e84
32 files changed
+1447 -424

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
//go:build !wasm
package terminal
import "github.com/lixenwraith/terminal/internal/env"
// DetectColorMode determines terminal color capability from environment:
// 16 colors on text consoles, true color where announced, else 256. It
// reports what the terminal can show; New also honours NO_COLOR.
func DetectColorMode() ColorMode {
switch env.Colors() {
case 16:
return ColorMode16
case 1 << 24:
return ColorModeTrueColor
}
return ColorMode256
}