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

server.Server.ifShell

TypeScript

View as Markdown

Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
Other languages
Python Ruby Lua Rust GoJava.NET C++ Swift
ifShell ( condition : : string , command : : string , options : : IfShellOptions ) → Promise<void>
method [source]
method [source]
ifShell

Run one command or another depending on a condition.

In other ports Run one tmux command or another, on a shell test

Examples

await server.ifShell("test -d /tmp", "display-message 'present'");
>>> server.if_shell('true', 'set -g @if_test yes')
>>> server.cmd('show-options', '-gv', '@if_test').stdout[0]
'yes'

0 declared, 0 inherited

Esc

Type to search.