terminaltitle

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package terminaltitle extracts window titles from a streaming UTF-8 PTY.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

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

Tracker is a bounded, streaming parser for ESC ] 0/2 title sequences. Bytes >= 0x80 are UTF-8 data, never C1 controls (e.g. 本 contains 0x9c). One session owns each tracker and calls Write serially.

func New

func New(save func(string) error) *Tracker

func (*Tracker) Write

func (t *Tracker) Write(chunk []byte) error

Write coalesces changes within a chunk and skips repeated titles. Failed saves are retried on subsequent output without discarding parser state. Oversized and cancelled sequences are ignored; original PTY bytes are intact.

Jump to

Keyboard shortcuts

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