On this page
libtmux.Server.if_shell
- Module
- libtmux
- Declared in
- Server
- Package
- libtmux
- Source
- src/libtmux/server.py
-
Execute a tmux command conditionally via
$ tmux if-shell.Examples
>>> server.if_shell('true', 'set -g @if_test yes') >>> server.cmd('show-options', '-gv', '@if_test').stdout[0] 'yes'- Parameters
-
-
shell_command ( str ) – Shell command whose exit status determines which tmux command runs.
-
tmux_command ( str ) – Tmux command to run if *shell_command* succeeds (exit 0).
-
else_command ( str | None ) – Tmux command to run if *shell_command* fails (non-zero exit).
-
background ( bool | None ) – Run the shell command in the background (
-bflag). -
target_pane ( str | None ) – Target pane for format expansion (
-tflag).
-
0 declared, 0 inherited