# session.Session.new_window

- **Module:** session.Session
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/session.rs#L521
- **Page:** https://libtmux.org/reference/rs/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.
