# unbind-key -n 9 \; \
# unbind-key -n \\; # this unmaps ;
#
+# Due to Tmux's handling of errors (they abort the rest of the mapping) the
+# select-window command is actually executed as last part of the mapping.
+#
# If a secondary chaining (e.g. prefix ;;3) is requested, a second file like
# the generated one must be loaded with ; to jump to windows 20-29. Therefore
# the following line is added in this case.
for (my $i = 0; $i < 10; $i++) {
- print "bind-key -n $i select-window -t :$level$i \\; ";
+ print "bind-key -n $i ";
for (my $j = 0; $j < 10; $j++) {
print "unbind-key -n $j \\; ";
}
- print "unbind-key -n \\\\;\n";
+ print "unbind-key -n \\\\; \\; ";
+ # Do the select-window last. If the window doesn't exist the failing
+ # select-window command prevents unbinding the other keys.
+ print "select-window -t :$level$i\n";
}
if (defined $path) {