Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-rs latest

MenuItem.new

Show label(), and run command() when the person presses key().

Source and package
Qualified name
libtmux::server::interactive::MenuItem::new
Module
server.interactive
Declared in
MenuItem
Package
libtmux
Source
crates/libtmux/src/server/interactive.rs
#[must_use] pub fn new( label: impl Into<OsString>, key: impl Into<OsString>, command: impl Into<OsString>, ) -> Self

Description#

key() is a tmux key name, or - for a line that cannot be chosen.

Examples#

use libtmux::MenuItem;
let item = MenuItem::new("Kill the session", "k", "kill-session");
assert_eq!(item.label(), "Kill the session");
Parameters
Esc

Type to search.

Reference previewOpen reference