Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

Python API

method libtmux stable

Server.bind_key

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

Source and package
Qualified name
libtmux.Server.bind_key
Module
libtmux
Declared in
Server
Package
libtmux
Source
src/libtmux/server.py
Other languages
PowerShell Julia Ruby Lua TypeScript RustGoJavaC#C++ Swift Kotlin Scala F#
bind_key ( self, key: str, command: str, key_table: str | None = None, note: str | None = None, repeat: bool | None = None, ) → None

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).

tmux command bind-key

In other ports Bind a key to a tmux command
  • PowerShell
    No source-verified PowerShell equivalent is recorded for this operation.
  • Julia
    No source-verified Julia equivalent is recorded for this operation.
  • 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
  • Rust
  • Go
  • Java
  • C#
  • C++
  • Swift
    no equivalent on Server
  • Kotlin
    No source-verified Kotlin equivalent is recorded for this operation.
  • Scala
    No source-verified Scala equivalent is recorded for this operation.
  • F#
    No source-verified F# equivalent is recorded for this operation.
Esc

Type to search.

Reference preview Open reference