ArchLinux 2018.10.01: Install byobu for terminal multiplexer

This article will describe installing byobu for terminal multiplexer. Byobu is frontend for tmux and screen.

1 Install byobu

Install byobu and tmux. The tmux is installed as backend.

$ sudo pacman -Sy --noconfirm git base-devel
$ git clone https://aur.archlinux.org/byobu.git
$ cd byobu
$ makepkg -s --noconfirm
$ sudo pacman -Sy --noconfirm tmux
$ sudo pacman -U --noconfirm ./*.pkg.tar.xz

2 PROMPT_COMMAND

Environment variable PROMPT_COMMAND sets window name of byobu, tmux and screen dynamically.

#!/bin/sh

cat <<EOF >> .bashrc
case \${TERM} in
  screen*|vt*)
    # PROMPT_COMMAND on emacs duplicates prompt string.
    if [ -z "\${INSIDE_EMACS}" ]; then
      export PROMPT_COMMAND='printf "\033k%s:%s\033\\\\" \
"\${HOSTNAME%%.*}" \$(basename "\${PWD/#\$HOME/~}")'
    fi
    ;;
  *)
    unset PROMPT_COMMAND
    ;;
esac
EOF

3 Run byobu

Run byobu with byobu command.

$ byobu

The byobu is displayed.

0001_byobu.png