fps

package
v1.223.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fps centralizes the optional spinner redraw-rate override so every spinner in Atmos honors a single control.

Spinners default to the bubbles rate. When recording VHS demos, frequent redraws of off-camera spinners can scroll enough to trip VHS's scrollback handling (charmbracelet/vhs#657/#659) and hang the recording. Setting ATMOS_SPINNER_FPS to a lower positive integer slows every spinner; leaving it unset preserves the default for normal interactive use.

Index

Constants

View Source
const EnvVar = "ATMOS_SPINNER_FPS"

EnvVar is the environment variable that overrides the spinner redraw rate (frames per second).

View Source
const MaxFPS = 60

MaxFPS bounds the override so a bad value can't busy-loop the renderer.

Variables

This section is empty.

Functions

func Apply

func Apply(s *spinner.Model)

Apply slows a spinner model's redraw rate to ATMOS_SPINNER_FPS when that env var is set to a positive integer (capped at MaxFPS). When the var is unset or invalid the model is left at its existing rate. Call it right after creating (and configuring) any bubbles spinner.Model.

func FromEnv

func FromEnv() int

FromEnv returns the spinner redraw rate (frames per second) parsed from ATMOS_SPINNER_FPS, or 0 when unset/invalid (meaning "keep the default rate").

Types

This section is empty.

Jump to

Keyboard shortcuts

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