libtmux Reference MCP Search
On this page

server.Server.prompt_history

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
crates/libtmux/src/server.rs
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.

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.meets(&libtmux::since::PROMPT_HISTORY) {
    assert!(server.prompt_history(PromptKind::Command).await?.is_empty());
}

guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.