# pane.Pane.clearHistory

- **Module:** pane
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/pane.ts#L442
- **Page:** https://libtmux.org/en/ts/latest/reference/pane-pane-clearhistory/

```
clearHistory(): Promise<void>
```

Discard this pane's scrollback history.

## Examples

```ts
await pane.clearHistory();
```

## tmux command

The tmux commands behind `clearHistory`.

- [`clear-history`](/en/tmux/latest/manual/clear-history/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_clear_history_entry`](/en/tmux/latest/reference/c-variable-cmd_clear_history_entry/) (attribute)
- [`cmd_capture_pane_exec`](/en/tmux/latest/reference/c-function-cmd-capture-pane-c-cmd_capture_pane_exec/) (function)

## In other ports

Clear a pane's scrollback

| Language | Equivalent |
| --- | --- |
| Python | [`libtmux.Pane.clear_history`](/en/py/latest/reference/libtmux-pane-clear_history/) (method) |
| Lua | [`libtmux.Pane:clear_history`](/en/lua/latest/reference/libtmux-pane-clear_history/) (method) |
| Rust | [`pane.Pane.clear_history`](/en/rs/latest/reference/pane-pane-clear_history/) (method) |
| Go | [`tmux.Pane.ClearHistory`](/en/go/latest/reference/tmux-pane-clearhistory/) (method) |
| Java | [`io.github.libtmux.Pane.clearHistory`](/en/java/latest/reference/io-github-libtmux-pane-pane-clearhistory/) (method) |
| C# | [`LibTmux.Pane.ClearHistoryAsync`](/en/csharp/latest/reference/libtmux-pane-clearhistoryasync/) (method) |
| C++ | [`libtmux::Pane::clear_history`](/en/cxx/latest/reference/libtmux-pane-clear_history/) (method) |
| Swift | [`Server.clearHistory(_:)`](/en/swift/latest/reference/server-clearhistory(_-)/) (method) |

No equivalent is recorded in Ruby, PowerShell, Julia, Elixir, Kotlin, Scala or F#.
