# libtmux.Server.clear_prompt_history

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/server.py#L1773
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-server-clear_prompt_history/

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

```
libtmux.Server.clear_prompt_history(
    self,
    prompt_type: t.Literal[
        "command", "search", "target", "window-target"
    ]
    | None = None,
) -> None
```

Clear prompt history via [`$ tmux clear-prompt-history`](/en/tmux/latest/manual/clear-prompt-history/).

## Examples

```python
>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.3"):
...     server.clear_prompt_history()
```

## Parameters

- `prompt_type` (`t.Literal["command", "search", "target", "window-target"] | None`): Prompt type to clear (``-T`` flag).

## In other ports

### Forget what has been typed at command prompts

- Rust: [`server.Server.clear_prompt_history`](/en/rs/latest/reference/server-server-clear_prompt_history/) (method)
- Go: [`tmux.Server.ClearPromptHistory`](/en/go/latest/reference/tmux-server-clearprompthistory/) (method)
- Java: [`io.github.libtmux.Prompt.Prompt.clear`](/en/java/latest/reference/io-github-libtmux-prompt-prompt-clear/) (method)
- C#: [`LibTmux.Server.ClearPromptHistoryAsync`](/en/csharp/latest/reference/libtmux-server-clearprompthistoryasync/) (method)
