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

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Sources/LibTmux/Creation.swift#L165
- **Page:** https://libtmux.org/en/swift/latest/reference/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`
