# plan.ops.sessions.NewSession

- **Module:** plan.ops.sessions
- **Package:** libtmux
- **Language:** Rust
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/plan/ops/sessions.rs#L27
- **Page:** https://libtmux.org/en/rs/latest/reference/plan-ops-sessions-newsession/

Create a session.

## Example

```rust
use libtmux::plan::{NewSession, Plan};

let mut plan = Plan::new();
let session = plan.add(NewSession::new("work"));
// The session, its first window, and that window's pane all come from one
// command, so none of them costs a second round trip.
let _ = (session, session.window(), session.pane());
```

## Members

- `new` (method): Create a detached session with this name.
- `start_directory` (method): Start the session's first window in this directory.
- `window_name` (method): Name the session's first window.
