# tmux.Pane.CopyMode

- **Module:** tmux.Pane
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/pane_modes.go#L120
- **Page:** https://libtmux.org/reference/go/tmux-pane-copymode/

```
tmux.Pane.CopyMode(ctx: context.Context, request: CopyModeRequest) -> error
```

CopyMode enters or cancels copy mode using the receiver's exact linked session-window-pane target. PageDown requires tmux 3.5 and follows [UnsupportedPolicy]. A version-probe error stops the operation. tmux resolves the receiver and optional SourcePane before processing Cancel; a stale target can therefore fail without resetting the current mode. Cancel then takes precedence over other actions.

Only stderr produces a redacted [CommandError]; nonzero exits without stderr
are ignored. Accepted mode changes are not rolled back.
