Skip to content

Instantly share code, notes, and snippets.

@judu
Created April 15, 2012 15:23
Show Gist options
  • Save judu/2393406 to your computer and use it in GitHub Desktop.
Save judu/2393406 to your computer and use it in GitHub Desktop.
Pack the tmux windows, keeping the order.
#!/bin/bash
# you can use it from tmux
# bind-key P run repack-tmux
ttt () {
local bef=-1
for i in `tmux list-windows | cut -d':' -f1`; do
local b=$(($bef + 1))
if [ $b -lt $i ]; then
tmux move-window -s $i -t $b
bef=$b
else
bef=$i
fi
done
}
ttt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment