libtmux Reference MCP Search
On this page

libtmux.Server.bind_key

View as Markdown

Module
libtmux
Declared in
Server
Package
libtmux
Source
src/libtmux/server.py
bind_key ( self , key : str , command : str , key_table : str | None = None , note : str | None = None , repeat : bool | None = None ) None
method [source]
method [source]
bind_key

Bind a key to a command via $ tmux bind-key.

Examples

>>> server.bind_key('F12', 'display-message test', key_table='root')
>>> server.unbind_key('F12', key_table='root')
Parameters
  • key ( str ) – Key to bind (e.g. C-a, F12, M-x).

  • command ( str ) – Tmux command to run when key is pressed.

  • key_table ( str | None ) – Key table to bind in (-T flag). Defaults to prefix.

  • note ( str | None ) – Note for the binding (-N flag).

  • repeat ( bool | None ) – Allow the key to repeat (-r flag).

0 declared, 0 inherited

Esc

Type to search.