# Server.newWindow(_:_:named:startDirectory:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Creation.swift#L140
- **Page:** https://libtmux.org/reference/swift/server-newwindow(_-_-named-startdirectory-)/

```
Server.newWindow(_:_:named:startDirectory:)(placement: WindowPlacement, neighbour: WindowLink, named: String?, startDirectory: String?) -> WindowAppearance
```

Creates a window next to one that already exists and returns its exact appearance.

- Parameters:
  - placement: which side of `neighbour` to take.
  - neighbour: the session-local window link to sit next to. Its session
    is the one the new window joins.
  - name: what to call it. Left out, tmux names it after what runs in it.
  - startDirectory: where the window's first pane starts.

## Raises

- `TmuxError`
