# LibTmux::Async::Server#new_session

- **Module:** LibTmux::Async
- **Package:** libtmux-async
- **Language:** Ruby
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ruby/blob/c8b839595d5a30e271e3f9be0d0fe811ddb11b7e/gems/libtmux/lib/libtmux/server.rb#L249
- **Public owner:** LibTmux::Server#new_session
- **Page:** https://libtmux.org/en/ruby/v0.1.0/reference/libtmux-async-server-new_session/

tmux command: [`new-session`](/en/tmux/latest/manual/new-session/)

```
def new_session: (
  name: ::String,
  command: ::Array[::String],
  receipt: true,
  ?width: ::Integer?,
  ?height: ::Integer?,
  ?window_name: ::String?,
  ?cwd: ::String?,
  ?environment: ::Hash[::String, ::String],
  ?timeout: ::Numeric,
  ?cancel: untyped
) -> ::LibTmux::CreationReceipt

def new_session: (
  name: ::String,
  command: ::Array[::String],
  ?receipt: false,
  ?width: ::Integer?,
  ?height: ::Integer?,
  ?window_name: ::String?,
  ?cwd: ::String?,
  ?environment: ::Hash[::String, ::String],
  ?timeout: ::Numeric,
  ?cancel: untyped
) -> ::LibTmux::Session
```

Behavior: Creation.

Behavior contract: Creation.

## Parameters

- `name` (`::String`)
- `command` (`::Array[::String]`)
- `receipt` (`true`) (for `new_session(name, command, receipt, width, height, window_name, cwd, environment, timeout, cancel) [overload 1]`)
- `width` (`::Integer?`)
- `height` (`::Integer?`)
- `window_name` (`::String?`)
- `cwd` (`::String?`)
- `environment` (`::Hash[::String, ::String]`)
- `timeout` (`::Numeric`)
- `cancel` (`untyped`)
- `receipt` (`false`) (for `new_session(name, command, receipt, width, height, window_name, cwd, environment, timeout, cancel) [overload 2]`)
