Skip to content

Instantly share code, notes, and snippets.

@kwmiebach
Last active October 5, 2025 10:53
Show Gist options
  • Save kwmiebach/7d62779d9822016f2197271af2198e82 to your computer and use it in GitHub Desktop.
Save kwmiebach/7d62779d9822016f2197271af2198e82 to your computer and use it in GitHub Desktop.
Clean up byobu config for dumb terminals
# tmux source-file ~/.tmux.conf
# find . -name "*tmux.conf"
# ./.config/byobu/.tmux.conf
# vim $(find . -name "*tmux.conf")
# tmux source-file $(find . -name "*tmux.conf")
# use ctrl-a as prefix which conflicts with:
# - vim to increase a number in the text
# - fish to go to beginning of line
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Bind Page Up to enter copy-mode
bind-key -n PageUp copy-mode
# Kill window
bind k kill-window
# Enable mouse support for easier scrolling.
# Also good for vim with tmux:
#set -g mouse on
# Set default window name
set -g automatic-rename on
# Reload tmux configuration
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# In some versions some options do not work yet or anymore:
# - ubuntu 22.04 in 3.2a-4ubuntu0.2
# - linux mint 20.3 in 3.0a-2ubuntu0.4
# On the other hand:
# - debian 11 in 3.1c-1+deb11u1
# That's why we try to put duplicate commands
# so this config file works on all machines where possible.
# Bash as default shell. Adjust path to binary to your system:
#set -g default-shell /bin/bash
bind-key -n F2 new-window -c "#{pane_current_path}" \; rename-window "-"
# go to prv / next window
bind-key -n F3 previous-window
bind-key -n F4 next-window
# join the right pane into the current with a vertical divider
bind-key -n C-l join-pane -h -s :+1
# and break it again:
bind-key -n M-l break-pane -t :+1 \; previous-window
# join the left pane into the current with a vertical divider
# -b = before
bind-key -n C-h join-pane -h -b -s :-1
# and break it again:
bind-key -n M-h break-pane -t :1 \; next-window
# CRITICAL - MUST BE DIFFERENT ACROSS MACHINES, DIFFERENT VERSIONS OF TMUX
if-shell "[ -f ~/.mark1.tmux ]" "source-file ~/.local/dot/.tmux.conf.include1"
if-shell "[ -f ~/.mark2.tmux ]" "source-file ~/.local/dot/.tmux.conf.include2"
# scrollback mode
bind-key -n F7 copy-mode
# rename window F8 or session Ctrl-F8
bind-key -n F8 command-prompt -p "(rename-window) " "rename-window '%%'"
bind-key -n C-F8 command-prompt -p "(rename-session) " "rename-session '%%'"
###########################
# Colors
###########################
# color status bar
set -g status-bg black
set -g status-fg '#7FFF00'
# status bar colors and pipe, does not work on some machines, works on debian 11?
setw -g window-status-current-format '#[bg=green,fg=black]#W'
setw -g window-status-format '#W'
setw -g window-status-separator '|'
# A. In newer versions of tmux (from tmux 2.9) we need:
# window-status-style or window-status-current-style
# Invert colors for the current window:
set-window-option -g window-status-current-style fg=black,bg='#7FFF00'
# remove the asterisk indicating current window:
set-window-option -g window-status-current-format ' #W '
# remove numbering and the colon:
set-window-option -g window-status-format ' #W '
# B. In older versions, the correct options are:
# but those are deprecated in newer versions.
# Set default terminal colors to green
# (what does this do and is it necessary?)
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Disable fancy Unicode characters
set -g pane-border-format ' '
set -g pane-border-indicators off
# setw -g utf8 off # deprecated in newer tmux versions
# Remove byobu icons and logo
set -g status-left '#S - '
set -g status-right ''
# vim .byobu/status
tmux_left="session"
tmux_right="#hostname #ip_address #time_utc date time"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment