termtitle

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package termtitle provides dynamic terminal window title updates based on user command history using an LLM to generate contextual titles.

Index

Constants

View Source
const (
	// MaxWindowSize is the maximum number of commands to track in the sliding window.
	MaxWindowSize = 100

	// MaxBackoffInterval is the maximum number of commands between title updates.
	MaxBackoffInterval = 40

	// InitialBackoffInterval is the initial number of commands after which to update.
	InitialBackoffInterval = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles terminal title updates with exponential backoff.

func NewManager

func NewManager(runner *interp.Runner, logger *zap.Logger) *Manager

NewManager creates a new terminal title manager.

func (*Manager) GetCurrentTitle

func (m *Manager) GetCurrentTitle() string

GetCurrentTitle returns the current window title.

func (*Manager) RecordCommand

func (m *Manager) RecordCommand(command string)

RecordCommand records a command and potentially triggers a title update. This should be called after each command is executed.

func (*Manager) Reset

func (m *Manager) Reset()

Reset resets the manager state, clearing the command window and resetting backoff.

func (*Manager) ResetTitle

func (m *Manager) ResetTitle()

ResetTitle clears the terminal window title.

Jump to

Keyboard shortcuts

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