terminallink

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package terminallink is the compatibility facade for terminal callers of the presentation-neutral contentlink recognition core.

New rendered surfaces should import internal/contentlink directly. Existing Workspaces callers retain this package while they migrate in small slices.

KindIssue is emitted for td-<hex> ids so a later terminal | file + td split can bind a live td pane. It must not open internal/app/issue_preview.go. KindDiff is emitted for existence-gated lowercase hex revs, "commit <rev>", and A..B / A...B ranges. HEAD and branch names are not scanned.

Index

Constants

View Source
const (
	MaxResourceLocatorChars   = contentlink.MaxResourceLocatorChars
	MaxResourceMatchesPerLine = contentlink.MaxResourceMatchesPerLine
)
View Source
const (
	KindURL      = contentlink.KindURL
	KindFile     = contentlink.KindFile
	KindIssue    = contentlink.KindIssue
	KindDiff     = contentlink.KindDiff
	KindResource = contentlink.KindResource
	KindInternal = contentlink.KindInternal
	KindSession  = contentlink.KindSession
)
View Source
const MaxNewDiffResolves = contentlink.MaxNewDiffResolves

Variables

This section is empty.

Functions

func Activatable added in v1.0.3

func Activatable(kind Kind) bool

func Decorate

func Decorate(line string, spans []Span) string

func IssueID added in v0.99.0

func IssueID(value string) bool

func Markdown

func Markdown(path string) bool

Markdown reports whether path should open as rendered markdown.

func OpenHTTP

func OpenHTTP(raw string) tea.Cmd

OpenHTTP opens a validated http(s) URL in the system browser.

func OpenRegular

func OpenRegular(absolute string) (*os.File, error)

OpenRegular opens the EvalSymlinks result of absolute when it is a regular file. Callers own the returned handle.

func ResolveCommit added in v1.0.0

func ResolveCommit(workdir, rev string) (oid string, ok bool)

ResolveCommit reports whether rev names a commit in workdir.

func ResolveFile

func ResolveFile(base, raw string) (display, absolute string, ok bool)

ResolveFile maps a printed path onto a regular file on this machine.

It tries the selected root first, then an absolute or ~/ path. The file must exist, be regular, and survive EvalSymlinks. It does not have to sit inside the selected worktree. Display is a root-relative slash path when the file is inside base, otherwise the resolved absolute path.

func SafeHTTPURL

func SafeHTTPURL(raw string) (string, bool)

SafeHTTPURL trims trailing prose punctuation and accepts only http(s) URLs with a host and no control characters.

func SessionName added in v1.2.0

func SessionName(value string) bool

func StripOSC8

func StripOSC8(line string) string

func WrapVisualRange

func WrapVisualRange(line string, startCol, endCol int, open, close string) string

Types

type DiffResolver added in v1.0.0

type DiffResolver = contentlink.DiffResolver

type Extra

type Extra = contentlink.Extra

func ResolveGitSpec added in v1.0.0

func ResolveGitSpec(workdir, raw string) (value string, extra Extra, ok bool)

ResolveGitSpec existence-gates a scanner token: a lowercase hex rev, "commit <rev>", or A..B / A...B. HEAD and branch names are refused here even if git would accept them — those are CLI-only.

type Kind

type Kind = contentlink.Kind

Compatibility aliases keep terminal hosts source-compatible while the presentation-neutral contentlink package remains recognition authority.

type Options added in v1.0.3

type Options = contentlink.Options

type Resolver

type Resolver = contentlink.Resolver

type ResourceMatcher added in v1.0.3

type ResourceMatcher = contentlink.ResourceMatcher

type Span

type Span = contentlink.Span

func Scan

func Scan(line string, resolve Resolver, resolveDiff DiffResolver) []Span

func ScanWith added in v1.0.3

func ScanWith(line string, opts Options) []Span

Jump to

Keyboard shortcuts

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