# LibTmux.NewWindowRequest.NewWindowRequest

- **Module:** LibTmux.NewWindowRequest
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Requests/NewWindowRequest.cs#L23
- **Page:** https://libtmux.org/reference/dotnet/libtmux-newwindowrequest-newwindowrequest/

```
LibTmux.NewWindowRequest.NewWindowRequest(name: string?, startDirectory: string?, attach: bool, index: string?, command: string?, environment: IReadOnlyDictionary<string, string>?, direction: WindowDirection?, targetWindow: string?, killExisting: bool, selectExisting: bool)
```

Initializes a window-creation request.

## Parameters

- `name` (string?) — The window name.
- `startDirectory` (string?) — The working directory for the first pane.
- `attach` (bool) — Whether the new window becomes current.
- `index` (string?) — The window index to create at.
- `command` (string?) — The command the first pane runs.
- `environment` (IReadOnlyDictionary<string, string>?) — Environment entries set on the window.
- `direction` (WindowDirection?) — Whether to insert before or after the target.
- `targetWindow` (string?) — The window to insert relative to.
- `killExisting` (bool) — Whether an existing window at the index is replaced.
- `selectExisting` (bool) — Whether an existing window is selected instead.

## Raises

- `ArgumentException` — <paramref name="index" /> and <paramref name="targetWindow" /> both name
a position, so only one of them can be sent.
