# window.Window.resize

- **Module:** window.Window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/window.rs#L1033
- **Page:** https://libtmux.org/reference/rs/window-window-resize/

```
window.Window.resize(mut, width: u32, height: u32) -> Result<&mut Self, Error>
```

Resize the window to an exact size in cells.

Use [`Window::resize_by`] to move one edge instead.

# Errors

Returns an error when tmux refuses the size.

## Example

```rust
let session = server.new_session("sized").await?;
let mut window = session.windows().await?.remove(0);

window.resize(100, 40).await?;
assert_eq!((window.width(), window.height()), (100, 40));
```
