attach

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package attach is the half of dv that owns a terminal.

It does not know that dv talks to a database, what a datasource is, or what any of the cells it draws mean. It sends what the terminal did and draws what comes back, which is what keeps it unaffected by anything the session on the other side chooses to do.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(rwc io.ReadWriteCloser, opt Options) error

Run attaches over rwc and returns when the session ends, the client is detached, or the server refuses.

Types

type Options

type Options struct {
	// Version must match the server's exactly.
	Version string

	// BuildFingerprint is version.BuildFingerprint(): empty outside a
	// development build, where Version alone cannot tell a rebuilt binary
	// from the one already running in the server it is attaching to.
	BuildFingerprint string

	// WorkDir and DataSource are what this invocation asked for, passed on so
	// the server can build or move the session.
	WorkDir    string
	DataSource string

	// Screen is the terminal. Nil makes a real one, which is the ordinary
	// case; a test supplies a simulation screen and keeps it afterwards.
	Screen tcell.Screen

	// Err is where the server's warnings are printed. Nil discards them.
	Err io.Writer
}

Jump to

Keyboard shortcuts

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