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

Run a command after confirmation via $ tmux confirm-before.

Source and package
Qualified name
libtmux.Server.confirm_before
Module
libtmux
Declared in
Server
Package
libtmux
Source
src/libtmux/server.py
Other languages
PowerShell Julia Ruby Lua TypeScript Rust Go Java C# C++ Swift Kotlin Scala F#
confirm_before ( self, command: str, prompt: str | None = None, confirm_key: str | None = None, default_yes: bool | None = None, target_client: str | None = None, ) → None

Description#

Always uses -b (background) to avoid blocking the command queue. Use send-keys -K -c <client> to provide the confirmation key.

Requires tmux 3.3+ for -b flag support.

Examples#

Interactive confirmation requires tmux 3.4+; the wrapper itself works on 3.3+ but the send-keys -K -c <client> round-trip used here is unreliable on 3.3a:

>>> from libtmux.common import has_gte_version
>>> if has_gte_version("3.4"):
... with control_mode() as ctl:
... server.confirm_before(
... 'set -g @cf_test yes',
... target_client=ctl.client_name,
... )
... _ = server.cmd('send-keys', '-K', '-c', ctl.client_name, 'y')
... result = server.cmd('show-options', '-gv', '@cf_test').stdout[0]
... else:
... result = 'yes'
>>> result
'yes'
Parameters

tmux command confirm-before

In other ports Ask a client to confirm before running a 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
    no equivalent on Server
  • Go
  • Java
    no equivalent on Server
  • C#
  • C++
    no equivalent on Server
  • 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