# Libtmux_eio.Client.create_window

- **Module:** Libtmux_eio
- **Package:** libtmux-eio
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/eio/libtmux_eio.mli#L423
- **Public owner:** Libtmux_eio
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_eio-client-create_window/

```
val create_window :
  ?index:int ->
  ?name:string ->
  ?spawn:Libtmux.Spawn.t ->
  t -> Libtmux.Session.target -> (Libtmux.Created.t, Libtmux.Error.t) result
```

Create detached, rejecting an occupied explicit index.

## Parameters

- `index?` (`int`)
- `name?` (`string`)
- `spawn?` (`Libtmux.Spawn.t`)
- `arg1` (`t`)
- `arg2` (`Libtmux.Session.target`)

## tmux command

The tmux commands behind `create_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) |
| 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#.
