Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

tmux.CommandObserver

Go
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
tmux
Package
github.com/libtmux/libtmux-go/tmux
Source
tmux/observer.go
struct tmux.CommandObserver
struct [source]
struct [source]
struct tmux.CommandObserver

CommandObserver receives one CommandTrace per tmux command a Server and the values derived from it run:

server, err := tmux.NewServer(tmux.ServerOptions{ CommandObserver: func(trace tmux.CommandTrace) { slog.Info("tmux", "command", trace.Subcommand, "transport", trace.Transport.String(), "duration", trace.Duration, "exit", trace.ExitCode) }, }) if err != nil { log.Fatal(err) }

It is called synchronously on the goroutine that ran the command, after the command finishes and before its result is returned, so a slow observer slows every command. Operations may invoke it concurrently; synchronize shared state. A nil observer costs nothing, not even the clock reads.

It sees the version probes this package runs on its own behalf, and the identity probe a daemon guard runs to decide whether a failure was a replaced daemon, so one call can produce more than one trace.

0 declared, 0 inherited

Esc

Type to search.