# LibTmux::Model::SessionRef.new-window

- **Module:** LibTmux::Model
- **Package:** LibTmux
- **Language:** Raku
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-raku/blob/0b5dd3d32e20f83a0069874e33eab0eb48f55962/lib/LibTmux/Model.rakumod#L135
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-model-sessionref-new-window/

```
method new-window(Str :$name, :$index = Count, Bool :$select = False,
                      Bool :$replace = False, Str :$directory, Str :$shell-command,
                      Bool :$empty = False, Associative:D :$environment = Map.new --> WindowRef:D)
```

Create a window and return its reported identity without refreshing observations.

Create a window and return its reported identity without refreshing observations.

## Parameters

- `$name?` (`Str`)
- `$index?`
- `$select?` (`Bool`)
- `$replace?` (`Bool`)
- `$directory?` (`Str`)
- `$shell-command?` (`Str`)
- `$empty?` (`Bool`)
- `$environment?` (`Associative:D`)

## tmux command

The tmux commands behind `new-window`.

- [`new-window`](/en/tmux/latest/manual/new-window/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_new_window_entry`](/en/tmux/latest/reference/c-variable-cmd_new_window_entry/) (attribute)
- [`cmd_new_window_exec`](/en/tmux/latest/reference/c-function-cmd-new-window-c-cmd_new_window_exec/) (function)

## In other ports

Create a window

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Session.new_window`](/en/py/latest/reference/libtmux-session-new_window/) (method) |
| Ruby | [`LibTmux::Session#new_window`](/en/ruby/latest/reference/libtmux-session-new_window/) (method) |
| Lua | [`libtmux.Session:new_window`](/en/lua/latest/reference/libtmux-session-new_window/) (method) |
| Erlang | [`tmux_window:create/2`](/en/erlang/latest/reference/tmux_window-create-2/) (function) |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | [`session.Session.newWindow`](/en/ts/latest/reference/session-session-newwindow/) (method) |
| Rust | [`session.Session.new_window`](/en/rs/latest/reference/session-session-new_window/) (method) |
| Go | [`tmux.Session.NewWindow`](/en/go/latest/reference/tmux-session-newwindow/) (method) |
| Java | [`io.github.libtmux.Session.newWindow`](/en/java/latest/reference/io-github-libtmux-session-session-newwindow/) (method) |
| Clojure | [`libtmux.core/new-window!`](/en/clojure/latest/reference/libtmux-core-new-window/) (function) |
| Kotlin | [`io.github.libtmux.kotlin.Session.newWindow`](/en/kotlin/latest/reference/io-github-libtmux-kotlin-session-newwindow/) (method) |
| Scala | [`io.github.libtmux.scaladsl.Session.newWindow`](/en/scala/latest/reference/io-github-libtmux-scaladsl-session-newwindow/) (method) |
| C# | [`LibTmux.Session.CreateWindowAsync`](/en/csharp/latest/reference/libtmux-session-createwindowasync/) (method) |
| C++ | [`libtmux::Session::new_window`](/en/cxx/latest/reference/libtmux-session-new_window/) (method) |
| Swift | [`Server.newWindow(in:named:startDirectory:at:environment:shell:)`](/en/swift/latest/reference/server-newwindow(in-named-startdirectory-)/) (method) |
| OCaml | [`Libtmux_unix.Client.create_window`](/en/ocaml/latest/reference/libtmux_unix-client-create_window/) (function) |
| Perl | [`LibTmux::Server::new_window`](/en/perl/latest/reference/libtmux-server-new_window/) (method). Explicit Server operation. Captured entities remain local observations; use a new snapshot to observe changes. |

No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp or F#.
