# server.interactive.MenuItem.new

- **Module:** server.interactive.MenuItem
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/server/interactive.rs#L246
- **Page:** https://libtmux.org/en/rs/latest/reference/server-interactive-menuitem-new/

```
server.interactive.MenuItem.new(label: impl Into<OsString>, key: impl Into<OsString>, command: impl Into<OsString>) -> Self
```

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

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

## Example

```rust
use libtmux::MenuItem;

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