aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/tmux.sh
blob: b9190432cb59d892fa78c2e9e29a453fce50f82d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

get_tmux_cmd() {
  TMUX_CMD="tmux"
  # The script supports targeting a different tmux socket
  # or configuration file solely for testing purposes. This
  # allows isolation between the tmux installation on the host
  # and the tmux session for the test run.
  if [ -n "${TMUX_SOCKET:-}" ]; then
    if [ -n "${TMUX_CONFIG_PATH:-}" ]; then
      TMUX_CMD="tmux -f $TMUX_CONFIG_PATH -L $TMUX_SOCKET"
    else
      TMUX_CMD="tmux -L $TMUX_SOCKET"
    fi
  fi
  echo "$TMUX_CMD"
}