Server.confirm_before
Run a command after confirmation via $ tmux confirm-before.
Source and package
-
Description#
Always uses
-b(background) to avoid blocking the command queue. Usesend-keys -K -c <client>to provide the confirmation key.Requires tmux 3.3+ for
-bflag 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
-
-
confirm_key(str | None) # – Key to accept as confirmation (-cflag). Default isy. Requires tmux 3.4+. -
default_yes(bool | None) # – Make Enter default to yes (-yflag). Requires tmux 3.4+. -
target_client(str | None) # – Target client (-tflag).
tmux command#
The tmux commands behind confirm_before.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
Ask a client to confirm before running a command
| Language | Equivalent |
|---|---|
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no equivalent on Server |
| Rust | no equivalent on Server |
| Go | tmux |
| Java | no equivalent on Server |
| C# | Lib |
| C++ | no equivalent on Server |
| Swift | no equivalent on Server |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |
No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.