# Server.respawn(_:running:killingExisting:startDirectory:)

- **Module:** Server
- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Sources/LibTmux/Navigation.swift#L326
- **Page:** https://libtmux.org/en/swift/latest/reference/server-respawn(_-running-killingexisting-startdirectory-)/

```
Server.respawn(_:running:killingExisting:startDirectory:)(pane: Pane, running: [String], killingExisting: Bool, startDirectory: String?) -> ()
```

Restarts the command in a pane.

- Parameters:
  - pane: the pane to restart.
  - command: what to run instead. Omitted, tmux repeats the command
    the pane was created with.
  - killingExisting: replaces whatever is still running, rather
    than refusing while the pane is busy.
  - startDirectory: where to start the replacement command.

## Raises

- `TmuxError`
