# window.Window.resize

- **Module:** window.Window
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/window.rs#L1093
- **Page:** https://libtmux.org/en/rs/latest/reference/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));
```
