# tmuxtest.PTYProcess.CloseContext

- **Module:** tmuxtest.PTYProcess
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/tmuxtest/pty_process.go#L189
- **Page:** https://libtmux.org/reference/go/tmuxtest-ptyprocess-closecontext/

```
tmuxtest.PTYProcess.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.
