tmux

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Path is the default path to the tmux executable on disk.
	Path = "/usr/bin/tmux"
	// SessionName is the string to use when naming a tmux session.
	SessionName = "mdrip"
)

Variables

This section is empty.

Functions

func IsProgramInstalled

func IsProgramInstalled(programName string) bool

IsProgramInstalled checks for tmux.

Types

type Tmux

type Tmux struct {
	// contains filtered or unexported fields
}

Tmux holds information about a tmux process (https://github.com/tmux/tmux).

func NewTmux

func NewTmux(programName string) *Tmux

NewTmux is a ctor.

func (Tmux) Adapt

func (t Tmux) Adapt(addr string)

Adapt opens a websocket to the given address, and sends what it gets to tmux.

func (Tmux) IsUp

func (t Tmux) IsUp() bool

IsUp true if tmux appears to be running.

func (Tmux) Write

func (t Tmux) Write(bytes []byte) (n int, err error)

Write bytes to a tmux session for interpretation as shell commands.

Uses this kludge:

writes bytes to a temp file,

tells tmux to load that file into a tmux paste buffer,

then tells tmux to 'paste' it into a session for what looks a lot
like use-behavior.  yay tmux.

TODO: look for a better tmux api (dbus?)

Jump to

Keyboard shortcuts

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