Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 708 Bytes

File metadata and controls

35 lines (27 loc) · 708 Bytes

(cli-exit-codes)=

Exit Codes

tmuxp uses standard exit codes for scripting and automation.

Code Meaning
0 Success
1 General error (config validation, tmux command failure)
2 Usage error (invalid arguments, missing required options)

Usage in scripts

Because the exit code is meaningful, a script can check it and react. Test it explicitly with $?:

#!/bin/bash
tmuxp load my-workspace.yaml
if [ $? -ne 0 ]; then
    echo "Failed to load workspace"
    exit 1
fi

Or short-circuit with || to handle the failure inline:

#!/bin/bash
tmuxp load -d my-workspace.yaml || {
    echo "tmuxp failed with exit code $?"
    exit 1
}