warpfocus

package
v1.45.13 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

ABOUTME: Warp session deep-link capture for click-to-focus. ABOUTME: Validates WARP_FOCUS_URL / WARP_TERMINAL_SESSION_UUID and rejects unrelated Warp URIs.

Index

Constants

View Source
const (
	// FocusURLEnv is the channel-aware deep link Warp injects into each pane.
	FocusURLEnv = "WARP_FOCUS_URL"
	// SessionUUIDEnv is the 32-char hex UUID of the originating Warp pane.
	SessionUUIDEnv = "WARP_TERMINAL_SESSION_UUID"
)

Variables

This section is empty.

Functions

func FromEnv

func FromEnv() string

FromEnv returns a validated Warp session focus URL from the current process environment. Prefers WARP_FOCUS_URL (channel-aware). Falls back to WARP_TERMINAL_SESSION_UUID as warp://session/<hex>, then to tmux's copy of those variables when the process is inside tmux. Empty when this process is not a Warp host (for example Cursor or VS Code launched from a Warp pane, which inherit Warp's environment).

func FromSessionUUID

func FromSessionUUID(raw string) string

FromSessionUUID builds warp://session/<hex> from a 32-char hex UUID or a dashed UUID. Preview/OSS channels cannot be inferred from the UUID alone.

func IsWarpHost

func IsWarpHost() bool

IsWarpHost reports whether this process is running in a Warp terminal session, as opposed to an app that merely inherited Warp's environment (Cursor, VS Code, Ghostty launched from a Warp pane).

func Normalize

func Normalize(raw string) string

Normalize accepts an opaque Warp focus URL and returns a canonical scheme://session/<32-hex> form, or "" if the value is not a session deep link. Action, conversation, settings, and launch URIs are rejected.

func Open

func Open(focusURL string) error

Open launches a validated Warp session focus URL with the platform handler (open / xdg-open / rundll32). Callers must pass Normalize/FromEnv output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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