server.Server.prompt_history
- Module
- server
- Declared in
- Server
- Package
- libtmux
- Source
- crates/libtmux/src/server.rs
- Other languages
- Python Ruby Lua TypeScript GoJava.NET C++ Swift
-
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::UnsupportedCapabilitybelow 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
- Python
libtmux.Server.show_prompt_history - Ruby No source-verified Ruby equivalent is recorded for this operation.
- Lua No source-verified Lua equivalent is recorded for this operation.
- TypeScript no equivalent on
Server - Go
tmux.Server.ShowPromptHistory - Java
io.github.libtmux.Server.Server.promptHistory - .NET
LibTmux.Server.GetPromptHistoryAsync - C++ no equivalent on
Server - Swift no equivalent on
Server
- Python
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)True0 declared, 0 inherited