# tmuxtest.ControlMode.CloseContext

- **Module:** tmuxtest.ControlMode
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/tmuxtest/control.go#L74
- **Page:** https://libtmux.org/en/go/latest/reference/tmuxtest-controlmode-closecontext/

```
tmuxtest.ControlMode.CloseContext(ctx: context.Context) -> error
```

CloseContext starts an idempotent shutdown and waits within ctx. Concurrent calls join the same shutdown. If ctx ends after shutdown starts, shutdown continues and a later call may wait for completion; an already-ended ctx does not start shutdown.
