sysinfo

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTermEnv added in v0.1.0

func SetTermEnv(termType string) error

SetTermEnv sets the TERM environment variable to the specified value. Used during bootstrap to upgrade TERM for better color support.

Types

type SystemInfo

type SystemInfo struct {
	// OS Information
	OS           string // runtime.GOOS (darwin, linux, windows)
	Architecture string // runtime.GOARCH (amd64, arm64, etc.)
	OSVersion    string // OS version (from getOSVersion())

	// Terminal Information
	TermType      string // $TERM
	ColorTerm     string // $COLORTERM (truecolor indicator)
	ColorFGBG     string // $COLORFGBG
	DetectedTheme string // "dark", "light", "unknown"

	// Terminal Dimensions (requires tcell.Screen)
	TerminalWidth  int
	TerminalHeight int

	// Terminal Capabilities
	ColorSupport string // "monochrome", "16-color", "256-color", "truecolor"
	ColorCount   int    // Actual color count

	// Environment Variables
	XDGConfigHome string // $XDG_CONFIG_HOME
	XDGCacheHome  string // $XDG_CACHE_HOME
	Shell         string // $SHELL
	Editor        string // $VISUAL or $EDITOR

	// Paths (from config.PathManager)
	ConfigDir   string // From config.GetConfigDir()
	CacheDir    string // From config.GetCacheDir()
	ProjectRoot string // From os.Getwd()
}

SystemInfo contains client environment information including OS details, terminal capabilities, and environment variables affecting visual appearance.

func NewSystemInfo

func NewSystemInfo() *SystemInfo

NewSystemInfo collects all system information using terminfo lookup (no screen needed). This is the fastest method and suitable for CLI commands and early bootstrap. Terminal dimensions are not available without a running screen.

func (*SystemInfo) String

func (s *SystemInfo) String() string

String returns a human-readable string representation of system information.

func (*SystemInfo) ToMap

func (s *SystemInfo) ToMap() map[string]interface{}

ToMap returns system information as a map for serialization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL