platform

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package platform reports host-platform facts the TUI adapts its presentation to. It is stdlib-only and lives under cmd/mecatui/ui so the ui package can import it without crossing the client/theme-only import boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScrollKeysMarking

func ScrollKeysMarking() string

ScrollKeysMarking returns the user-facing label for the page-up/page-down scroll chords, adapted to the current platform. Mac prepends the physical gesture (fn+↑/fn+↓) while keeping the canonical name in parens, so a user who has remapped their terminal still recognises it. Single source of truth — every site that renders a "pgup/pgdn scroll" hint reads this instead of hardcoding the literal.

Types

type Platform

type Platform int

Platform is the host platform the TUI adapts its presentation to.

const (
	// PC is the default non-Mac desktop platform (Linux, Windows, etc.).
	PC Platform = iota
	// Mac is macOS (darwin): no dedicated PgUp/PgDn keys — the user presses
	// fn+↑/fn+↓ — so scroll-key markings adapt.
	Mac
)

func Current

func Current() Platform

Current returns the resolved platform. MECATUI_TEST_PLATFORM (values "pc" or "mac") can override detection; without it, the runtime platform is used. The environment is read at call time so production callers observe its current value.

func (Platform) String

func (p Platform) String() string

String renders the platform as the stable lowercase token used in env overrides and diagnostics: "pc" or "mac".

Jump to

Keyboard shortcuts

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