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

Rust API

Rust documentation

server.Server.prompt_history

Rust

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server.rs
Other languages
Python Ruby Lua TypeScript GoJava.NET C++ Swift
prompt_history ( self , kind : PromptKind ) → Result<Vec<TmuxText>, Error>
method [source]
method [source]
prompt_history

The entries tmux remembers for one kind of prompt.

tmux keeps a separate history per prompt kind, so the kind is required rather than defaulted: asking without one returns every kind at once, which is a different question.

Errors

Returns Error::UnsupportedCapability below tmux 3.3, and an error when tmux cannot be reached or refuses the listing.

In other ports Read what has been typed at command prompts

Examples

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?;
>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.3"):
... result = server.show_prompt_history()
... else:
... result = []
>>> isinstance(result, list)
True

0 declared, 0 inherited

Esc

Type to search.