# libtmux:new-window

- **Package:** libtmux
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/creation.lisp#L23
- **Public owner:** libtmux
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-new-window/

```
(new-window client session &key name index cwd environment (command nil command-p) (shell-command nil shell-command-p) (detached t) cancel-token timeout output-limit)
```

Create a physical window in captured SESSION and return a COMMAND-OUTCOME.
NAME and CWD are literal strings. INDEX chooses a free link index; omission uses
tmux's next available index. DETACHED defaults true. ENVIRONMENT is a list/vector
of (name . value) string pairs. COMMAND is nonempty argv; SHELL-COMMAND is a
separate, mutually exclusive shell string. Omit both for tmux's default shell.
OUTCOME-VALUE supplies the resulting window; observation failure is separate.
Never replaces an occupied index or retries a mutation. Limits cover all I/O.

## Parameters

- `client`
- `session`
- `name?`
- `index?`
- `cwd?`
- `environment?`
- `command?`
- `shell-command?`
- `detached?`
- `cancel-token?`
- `timeout?`
- `output-limit?`

## 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)

## Guides

Pages that discuss `new-window`.

- [Explicit operations](/en/lisp/latest/guides/operations/)
