tty

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package tty answers one narrow question about a controlling terminal: is its line discipline canonical (line-buffered, "cooked") or raw. The shell-activity poller (internal/server/shellactivity.go) uses this to tell a program waiting for the user (raw mode — zsh's zle, readline, vim, Claude Code's trust prompt) from one doing batch work (canonical) — kb:adr/surfaces-shell-busy-from-tmux-process-state. This is a BSD ioctl (TIOCGETA); Muster is macOS-only (CLAUDE.md), so no other platform is supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCanonical

func IsCanonical(ttyPath string) (bool, error)

IsCanonical opens ttyPath read-only and reports whether ICANON is set on its line discipline via a TIOCGETA ioctl. O_NONBLOCK keeps the open from waiting on a device with nothing ready; O_NOCTTY keeps this process from acquiring ttyPath as its own controlling terminal. Measured not to disturb the shell process already attached to the tty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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