How to make tmux count windows starting from 1 instead of 0?

I was able to make GNU Screen start counting windows with the number 1 instead of the default 0 with this code in my .screenrc:

# Get rid of screen 0
bind c screen 1
bind ^c screen 1
bind 0 select 10

When I created windows in .screenrc I used screen 1 so that it would first try 1 and then count up if that window number was taken.

Asked By: hekevintran


The solution is to modify ~/.tmux.conf to:

# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1

Edit: unlike base-index, pane-base-index is a window option, so setw should be used, as @Jogusa pointed out.

Answered By: hekevintran
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.