NewSession
NewSession creates a test-owned tmux.Session and registers cleanup against its stable ID. An empty tmux.NewSessionRequest.Name receives a collision-checked temporary name. The request and referenced values are copied before tmux is called, and setup failures call testing.TB.Fatal. Cleanup belongs to t rather than ctx and continues to target the session if it is renamed.
Source and package
- Qualified name
-
tmuxtest.New Session - Package
- tmuxtest
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/tmuxtest/resources.go
- func NewSession( ctx context
.Context , t testing.TB, server tmux.Server , request tmux.New , ) tmuxSession Request .Session -
- Parameters
-
tmux command#
The tmux commands behind NewSession.
kill-session (the test ends, in t.Cleanup) new-session tmux C API#
The C declarations in tmux that implement these commands.
Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.
Create a session and its first pane
- 1
cmd_new_session_exec - calls → 2
spawn_window - calls → 3
spawn_pane - calls → 4
window_add_pane - calls → 5
window_pane_create