# window.Window.rename

- **Module:** window.Window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/window.rs#L384
- **Page:** https://libtmux.org/en/rs/latest/reference/window-window-rename/

```
window.Window.rename(mut, name: impl Into<TmuxArg>) -> Result<&mut Self, Error>
```

Rename the window and update this handle.

The name belongs to the window, so every session linking it sees the
change.

# Errors

Returns an error when tmux refuses the name.
tmux expands the name as a format before it checks it, so `#(command)`
in one runs a shell command. See [the crate documentation][crate#a-name-reaches-tmux-as-a-format]
before passing text a caller supplied.
