Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

Python documentation

libtmux.Server.show_prompt_history

Python

View as Markdown

Module
libtmux
Declared in
Server
Package
libtmux
Source
src/libtmux/server.py
Other languages
Ruby Lua TypeScript RustGoJava.NET C++ Swift
show_prompt_history ( self , prompt_type : t.Literal["command", "search", "target", "window-target"] | None = None ) → list[str]
method [source]
method [source]
show_prompt_history

Show prompt history via $ tmux show-prompt-history.

Parameters
  • prompt_type ( t.Literal["command", "search", "target", "window-target"] | None ) – Prompt type to show (-T flag).

Returns

list[str] Prompt history lines.

In other ports Read what has been typed at command prompts

Examples

>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.3"):
... result = server.show_prompt_history()
... else:
... result = []
>>> isinstance(result, list)
True
use libtmux::PromptKind;
let guard = libtmux::test::TestServer::new().await?;
let server = guard.server();
let version = server.capabilities().await?.tmux_version().clone();
// A fresh server has answered no prompts.
if version.has_behavior(&libtmux::since::PROMPT_HISTORY) {
assert!(server.prompt_history(PromptKind::Command).await?.is_empty());
}
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.