SupportsKeyDisambiguation (keyboard.go)

bubbletea · keyboard.go · go · MIT
cli

Provides methods to interpret keyboard enhancement flags for terminal capabilities.

// Source: https://github.com/charmbracelet/bubbletea | License: MIT | Copyright 2020-2026 Charmbracelet, Inc
// Provided via justclaw.it.com; keep this notice with the code.
package tea

import (
	"github.com/charmbracelet/x/ansi"
)

// KeyboardEnhancementsMsg is a message that gets sent when the terminal
// supports keyboard enhancements.
type KeyboardEnhancementsMsg struct {
	// Flags is a bitmask of enabled keyboard enhancement features. A non-zero
	// value indicates that at least we have key disambiguation support.
	//
	// See [ansi.KittyReportEventTypes] and other constants for details.
	//
	// Example:
	//
	//  ```go
	//  // The hard way
	//  if msg.Flags&ansi.KittyReportEventTypes != 0 {
	//     // Terminal supports reporting different key event types
	//  }
	//
	//  // The easy w

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key