
tmux source ~/.tmux.conf:
bad value: on
bad value: on
usage: send-prefix [-2] [-t target-pane]
bad value: on
unknown command: clear-history
bad value: on
bad value: off
unknown command: new-session
usage: split-window [-bdhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]
usage: split-window [-bdhvP] [-c start-directory] [-F format] [-p percentage|-l size] [-t target-pane] [command]
unknown key: n
unknown key: p
' returned 127copy-mode-vi v send -X begin-selection 2> /dev/null || true
' returned 127copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true
' returned 127copy-mode-vi Escape send -X cancel 2> /dev/null || true
' returned 127copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true
' returned 127copy-mode-vi H send -X start-of-line 2> /dev/null || true
' returned 127copy-mode-vi L send -X end-of-line 2> /dev/null || true
' returned 2.tmux.conf | sh -s _apply_configuration
: No such file or directoryal

Hello @Mr-jiangzhiguo,
I confirmed the master branch, commit 2b0cb0b43ce7b4d212d91415390db8faf1b421df1 works with Ubuntu 16.04.
$ vagrant init ubuntu/xenial64
$ vagrant up
$ vagrant ssh
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .
$ tmux
You likely made changes to .tmux.conf that breaks it 🤷♂️
I am not change the .tmux.conf and .tmux.conf.local,
I rm the tmux,then retry it:
git clone https://github.com/gpakosz/.tmux.git
ln -s .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
tmux source ~/.tmux.conf
and above error still exit.
Can you please make sure that
tmux processes, even the server one? (or reboot)
$ cut -c3- ~/.tmux.conf | sh -sx _apply_configuration
output:
+ tmux display -p #{pane_id}
no server running on /tmp/tmux-500/default
+ grep -o ^1 %.\+maximized.\+$
+ tmux list-panes -s -t -F #{pane_dead} #{pane_id} #{pane_start_command}
no server running on /tmp/tmux-500/default
+ true
+ sed -n -E -e s/^1 .+maximized.+'(%[0-9]+)'$/tmux swap-pane -s \1 -t \; kill-pane -t /p -e s/^1 (%[0-9]+) .+maximized.+''$/tmux swap-pane -s \1 -t \; kill-pane -t \1/p
+ echo
+ sed s/^ *//g
+ wc -l
+ tmux list-panes -t :
no server running on /tmp/tmux-500/default
+ tmux new-window -t : -P exec maximized... 2> /dev/null & tmux setw -t ":" remain-on-exit on; printf "Pane has been maximized, press <prefix>+ to restore. %s" ''
no server running on /tmp/tmux-500/default
+ tmux list-panes -t -F #{session_name}:#{window_index} #{pane_dead}
+ tmux display -t -p #{pane_id}
no server running on /tmp/tmux-500/default
+ tmux show -gv mouse
no server running on /tmp/tmux-500/default
+ uname -s
+ grep -qi discharging
+ printf %s
+ echo false
+ grep -E -o [0-9]+%
+ printf %s
+ awk -v charge= -v percentage= BEGIN { print charge + percentage / 100 }
+ grep InternalBattery
+ pmset -g batt
sh: 252: pmset: not found
+ grep -qi discharging /status
grep: /status: No such file or directory
+ echo false
+ cat
cat: '': No such file or directory
+ awk -v charge= -v capacity= BEGIN { print charge + capacity / 100 }
+ cat
cat: '': No such file or directory
+ cat
cat: '': No such file or directory
+ awk -v charge= -v energy_now= -v energy_full= BEGIN { print charge + energy_now / energy_full }
awk: cmd. line:1: fatal: division by zero attempted
+ find /sys/class/power_supply -maxdepth 1 -iname *bat*
+ awk { s = ($1 == 1) ? "true" : "false"; print s }
+ printf %s
+ awk -v charge= { print charge + $2 / 100 }
+ printf %s
+ tail -n +2
+ tr -d \r
+ wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining
sh: 286: wmic: not found
+ grep -q 1
+ sysctl -n hw.sensors.acpibat.raw0
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/raw0: No such file or directory
+ echo false
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.amphour3
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/amphour3: No such file or directory
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.amphour0
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/amphour0: No such file or directory
+ awk -v charge= -v remaining= -v full= BEGIN { print charge + remaining / full }
awk: cmd. line:1: fatal: division by zero attempted
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.watthour3
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/watthour3: No such file or directory
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.watthour0
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/watthour0: No such file or directory
+ awk -v charge= -v remaining= -v full= BEGIN { print charge + remaining / full }
awk: cmd. line:1: fatal: division by zero attempted
+ awk -v charge= -v count= BEGIN { print charge / count }
awk: cmd. line:1: fatal: division by zero attempted
+ tmux show -gqv @battery_bar_symbol_full ;
usage: show-options [-gqsvw] [-t target-session|target-window] [option]
+ show -gqv @battery_bar_symbol_empty ;
sh: 315: show: not found
+ show -gqv @battery_bar_length ;
sh: 316: show: not found
+ show -gqv @battery_bar_palette ;
sh: 317: show: not found
+ show -gqv @battery_hbar_palette ;
sh: 318: show: not found
+ show -gqv @battery_vbar_palette ;
sh: 319: show: not found
+ show -gqv @battery_status_charging ;
sh: 320: show: not found
+ show -gqv @battery_status_discharging
sh: 321: show: not found
+ tmux -q display -p #{client_width}
+ echo 80
+ awk -v n= { for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }
+ echo
+ awk BEGIN { printf "%.0f", () * }
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
+ cut -d -f1-
+ echo
+ printf #[fg=colour%s]
+ cut -d -f1-0
cut: invalid decreasing range
Try 'cut --help' for more information.
+ echo
+ printf #[fg=colour%s]
+ awk BEGIN { printf "%.0f", () * }
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
+ seq 1
seq: invalid floating point argument: ‘’
Try 'seq --help' for more information.
+ printf %0.s
+ seq 1
seq: invalid floating point argument: ‘’
Try 'seq --help' for more information.
+ printf %0.s
+ awk -v n= { for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }
+ echo
+ awk BEGIN { printf "%.0f", () * }
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
+ awk BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
+ awk BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: ^ syntax error
sh: 1: battery_hbar_fg: parameter not set
+ cat
This totally doesn't look like what should happen, mine starts with:
+ cat
+ set -e
+ export LC_NUMERIC=C
+ LC_NUMERIC=C
+ __newline='
'
+ _apply_configuration
...
Can you please try again with
$ cut -c3- ~/.tmux.conf | sh -sx _apply_configuration > log.txt 2>&1
Can you please also run tell me the output of
$ uname -s
and
$ locale
Thanks
$ cat log.txt:
+ tmux display -p #{pane_id}
+ grep -o ^1 %.\+maximized.\+$
+ tmux list-panes -s -t -F #{pane_dead} #{pane_id} #{pane_start_command}
+ sed -n -E -e s/^1 .+maximized.+'(%[0-9]+)'$/tmux swap-pane -s \1 -t \; kill-pane -t /p -e s/^1 (%[0-9]+) .+maximized.+''$/tmux swap-pane -s \1 -t \; kill-pane -t \1/p
+ echo
+ sed s/^ *//g
+ wc -l
+ tmux list-panes -t :
+ tmux new-window -t : -P exec maximized... 2> /dev/null & tmux setw -t ":" remain-on-exit on; printf "Pane has been maximized, press <prefix>+ to restore. %s" ''
+ tmux list-panes -t -F #{session_name}:#{window_index} #{pane_dead}
+ tmux display -t -p #{pane_id}
+ tmux show -gv mouse
+ uname -s
+ grep -qi discharging
+ printf %s
+ echo false
+ grep -E -o [0-9]+%
+ printf %s
+ awk -v charge= -v percentage= BEGIN { print charge + percentage / 100 }
+ grep InternalBattery
+ pmset -g batt
sh: 252: pmset: not found
+ grep -qi discharging /status
grep: /status: No such file or directory
+ echo false
+ cat
cat: '': No such file or directory
+ awk -v charge= -v capacity= BEGIN { print charge + capacity / 100 }
+ cat
cat: '': No such file or directory
+ cat
cat: '': No such file or directory
+ awk -v charge= -v energy_now= -v energy_full= BEGIN { print charge + energy_now / energy_full }
awk: cmd. line:1: fatal: division by zero attempted
+ find /sys/class/power_supply -maxdepth 1 -iname *bat*
+ awk { s = ($1 == 1) ? "true" : "false"; print s }
+ printf %s
+ awk -v charge= { print charge + $2 / 100 }
+ printf %s
+ tail -n +2
+ tr -d \r
+ wmic path Win32_Battery get BatteryStatus, EstimatedChargeRemaining
sh: 286: wmic: not found
+ grep -q 1
+ sysctl -n hw.sensors.acpibat.raw0
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/raw0: No such file or directory
+ echo false
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.amphour3
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/amphour3: No such file or directory
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.amphour0
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/amphour0: No such file or directory
+ awk -v charge= -v remaining= -v full= BEGIN { print charge + remaining / full }
awk: cmd. line:1: fatal: division by zero attempted
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.watthour3
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/watthour3: No such file or directory
+ cut -d -f1
+ sysctl -n hw.sensors.acpibat.watthour0
sysctl: cannot stat /proc/sys/hw/sensors/acpibat/watthour0: No such file or directory
+ awk -v charge= -v remaining= -v full= BEGIN { print charge + remaining / full }
awk: cmd. line:1: fatal: division by zero attempted
+ awk -v charge= -v count= BEGIN { print charge / count }
awk: cmd. line:1: fatal: division by zero attempted
+ tmux show -gqv @battery_bar_symbol_full ;
usage: show-options [-gqsvw] [-t target-session|target-window] [option]
+ show -gqv @battery_bar_symbol_empty ;
sh: 315: show: not found
+ show -gqv @battery_bar_length ;
sh: 316: show: not found
+ show -gqv @battery_bar_palette ;
sh: 317: show: not found
+ show -gqv @battery_hbar_palette ;
sh: 318: show: not found
+ show -gqv @battery_vbar_palette ;
sh: 319: show: not found
+ show -gqv @battery_status_charging ;
sh: 320: show: not found
+ show -gqv @battery_status_discharging
sh: 321: show: not found
+ tmux -q display -p #{client_width}
+ awk -v n= { for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }
+ echo
+ awk BEGIN { printf "%.0f", () * }
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
+ cut -d -f1-
+ echo
+ printf #[fg=colour%s]
+ cut -d -f1-0
cut: invalid decreasing range
Try 'cut --help' for more information.
+ echo
+ printf #[fg=colour%s]
+ awk BEGIN { printf "%.0f", () * }
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
+ seq 1
seq: invalid floating point argument: ‘’
Try 'seq --help' for more information.
+ printf %0.s
+ seq 1
seq: invalid floating point argument: ‘’
Try 'seq --help' for more information.
+ printf %0.s
+ awk -v n= { for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))" " }
+ echo
+ awk BEGIN { printf "%.0f", () * }
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "%.0f", () * }
awk: cmd. line:1: ^ syntax error
+ awk BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_fg=$%d", (() - 0.001) * 1 + 1 }
awk: cmd. line:1: ^ syntax error
+ awk BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: ^ syntax error
awk: cmd. line:1: BEGIN { printf "battery_hbar_symbol=$%d", () * (1 - 1) + 1 }
awk: cmd. line:1: ^ syntax error
sh: 1: battery_hbar_fg: parameter not set
+ cat
$ uname -s:
$ locale:
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
The fact that log.txt starts with tmux display -p #{pane_id} troubles me.
Can you please run
$ sha1sum .tmux.conf
a48b0b0f5609549277f2f5fc952ba5c9f13131d1 .tmux.conf
$ sha1sum .tmux.conf
a8252efab1bb9f30d245ad8f720ef42c1066ebed .tmux.conf
So your .tmux.conf file differs from mine despite telling me you did a fresh clone 🤷♂️
~$ cd .tmux && git log,
the last commit is 2b0cb0b43ce7b4d212d91415390db8faf1b421df.
then run
~/.tmux$ sha1sum .tmux.conf, it output
a8252efab1bb9f30d245ad8f720ef42c1066ebed .tmux.conf
Alright, git log reports 2b0cb0b43ce7b4d212d91415390db8faf1b421df is the last commit. Then what does git status say?
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean

The SHA1 sum of .tmux.conf has to be a48b0b0f5609549277f2f5fc952ba5c9f13131d1.
In last resort, can you please upload your ~/.tmux.conf as attachment?
Alright,
I should have guessed it earlier. The problem is that for some reason your git is configured to write files with CRLF (Windows) line endings.

Fix your Git configuration to make sure your /.tmux.conf and ~/.tmux.conf.local copies have LF (Unix) line endings.
yeah~
~$ git config --global core.autocrlf input~$ git config --global core.safecrlf true~$ sha1sum .tmux/.tmux.confa48b0b0f5609549277f2f5fc952ba5c9f13131d1 .tmux/.tmux.confthen, it work successful, thank you~
Glad it's solved. Enjoy!
Can you please make sure that
- you kill all
tmuxprocesses, even the server one? (or reboot)launch tmux then after tmux is launched run
$ cut -c3- ~/.tmux.conf | sh -sx _apply_configurationand paste the output here?
Fresh install on Ubuntu 19.10
I had to restart my computer for the tmux settings to work
Most helpful comment
Alright,
I should have guessed it earlier. The problem is that for some reason your git is configured to write files with CRLF (Windows) line endings.
Fix your Git configuration to make sure your
/.tmux.confand~/.tmux.conf.localcopies have LF (Unix) line endings.