# tmux.Window.Rename

- **Module:** tmux.Window
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/window_lifecycle.go#L348
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-window-rename/

```
tmux.Window.Rename(ctx: context.Context, name: string) -> (Window, error)
```

Rename changes the stable window through the receiver's exact winlink and returns a canonical freshly materialized [Window]. The returned winlink may therefore use another session when the WindowID is linked. If the command succeeds but refresh fails, Rename returns the receiver with that error. A transport or context error can be delivery-ambiguous; no rollback is attempted.
