# session.Session.new_window

- **Module:** session.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/session.rs#L491
- **Page:** https://libtmux.org/en/rs/latest/reference/session-session-new_window/

```
session.Session.new_window(self, options: impl Into<NewWindowOptions>) -> Result<Window, Error>
```

Create a window in this session and return it.

# Errors

Returns an error when tmux refuses the command or its output cannot be
decoded.
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.
