Recent Forum Posts
From categories:
page 1 of 212next »
Eric (guest) 13 Mar 2012 20:18
in discussion Hidden / Per page discussions » Resurrecting tmux Sessions After Reboot

Thanks for this! It works (just about) perfectly for me.

Your script doesn't save window names, is that correct? It doesn't for me, at least. I'm using tmux 1.6 so maybe that's the problem. Anyway, to get it to work I had the backup save the window name in ${session}:${window}.name and then read this file when restoring and run a tmux rename-window command.

Thanks, again. I just wish I had been running this yesterday…

by Eric (guest), 13 Mar 2012 20:18
hyb (guest) 01 Mar 2012 09:57
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Many thanks!

by hyb (guest), 01 Mar 2012 09:57
Forrest Zeisler (guest) 26 Feb 2012 02:45
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Thanks!

by Forrest Zeisler (guest), 26 Feb 2012 02:45
Matt (guest) 22 Feb 2012 16:07
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Just change inum=0 to be inum=1 and it should work just fine.

by Matt (guest), 22 Feb 2012 16:07
Vat (guest) 21 Feb 2012 19:55
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Minor issue. this doesn't work for people who have changed their tmux configuration to have 1-based window numbering (using this line: )

set -g base-index 1

by Vat (guest), 21 Feb 2012 19:55

What's different? Were your backups running alright? Were you able to resurrect any of your windows? If so, was the window history showing up properly? Did you modify the script's regex to look at your prompt information?

by mbmmbm, 08 Feb 2012 23:46
Diego (guest) 06 Feb 2012 21:52
in discussion Hidden / Per page discussions » Resurrecting GNU Screen Sessions After Reboot

How can it work?
When i use ./resurrect.sh -r , and after screen -r , my session is not the same

by Diego (guest), 06 Feb 2012 21:52
threecheese (guest) 31 Jan 2012 21:11
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Fixed a few things to make it work on my current (debian) system.

  1. `tmux lsw` outputs two lines (layout spec is on second line)
  2. fixed an operator on line 14 and bash-ified it (dbl braces)
#!/bin/bash

set -e

for session in $(tmux ls | awk -F: '{print $1}') ;do
  active_window=$(tmux lsw -t ${session} | awk -F: '/\(active\)$/ {print $1}')
  inum=
  for window in $(tmux lsw -t ${session} | awk -F: '{print $1}') ;do
    if [[ ${window} == 'layout' ]]; then
      continue
    fi
    if [[ ${window} -gt ${inum} ]] ;then
      echo "${session}:${window} -> ${session}:${inum}"
      tmux movew -d -s ${session}:${window} -t ${session}:${inum}
    fi
    if [[ ${window} == ${active_window} ]] ;then
      new_active_window=${inum}
    fi
    inum=$((${inum}+1))
  done
  tmux select-window -t ${session}:${new_active_window}
done
by threecheese (guest), 31 Jan 2012 21:11

If you use Connection Manager, you may as well use the multiple pane capability. Just drag any tab to a one side of the window you want to split, and the screen is split there. Merging of tabs works the same way.

by Tim (guest), 25 Jan 2012 06:30

Great! Thanks for the feedback.

by mbmmbm, 23 Jan 2012 18:24

Awesome! Thanks for the feedback.

by mbmmbm, 23 Jan 2012 18:09
Dante (guest) 18 Jan 2012 23:02
in discussion Hidden / Per page discussions » Resurrecting tmux Sessions After Reboot

Thanks, it works great for me, I was looking long time for this :)

by Dante (guest), 18 Jan 2012 23:02

What it's saying is "If the pane ID is greater than 0, then obviously there's more than just the default pane, so dump the pane layout for the window." It's not skipping pane 0. Later in the code, it will dump the contents of each pane to a file (including pane 0).

Perhaps your awk or sed commands are not GNU and are tripping it up. Try opening up a fresh tmux session and split window 0 into multiple panes. Run these commands and see where it fails:

  • session=0
  • window=0
  • tmux list-windows -t ${session}
  • tmux list-windows -t ${session} | awk -F'\[layout ' '/^'${window}':/ {print $2}'
  • tmux list-windows -t ${session} | awk -F'\[layout ' '/^'${window}':/ {print $2}' | awk '{print $1}'
  • tmux list-windows -t ${session} | awk -F'\[layout ' '/^'${window}':/ {print $2}' | awk '{print $1}' | sed 's/\]$//'

Thanks for checking the script out.

by mbmmbm, 21 Dec 2011 23:21
Justin Patrin (guest) 16 Dec 2011 22:44
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Many thanks.

by Justin Patrin (guest), 16 Dec 2011 22:44
Charles (guest) 16 Dec 2011 16:08
in discussion Hidden / Per page discussions » Resurrecting tmux Sessions After Reboot

Does your script work as is on tmux 1.5? I'm running CrunchBang 20111125 which is based on Debian Squeeze. It has tmux 1.5. Yet the layout of panes doesn't appeart to be saved. It's a zero byte file. At least I assume the pane layout is supposed to go in ${session}:${window}.layout?

It seemed to me that there was something not quite correct about this code:

##backup pane layout
if [ ${pane} -gt 0 ] ;then
tmux list-windows -t ${session} | awk -F'\[layout ' '/^'${window}':/ {print $2}' | awk '{print $1}' | sed 's/\]$//' >${backup_dir}/${session}:${window}.layout
fi
pane_full=${session}:${window}.${pane}

Why skip pane 0? Instead of listing the window in the first line inside the if, shouldn't it list the panes?

by Charles (guest), 16 Dec 2011 16:08
saurabh (guest) 30 Nov 2011 07:48
in discussion Hidden / Per page discussions » Extreme Multitasking with GNU Screen + Tabbed Client

Thanks for posting this info. I wanted to read up on conn manager + screen and your post was very useful.

by saurabh (guest), 30 Nov 2011 07:48

Hmm, my guess would be that you still have screen sessions open and you need to remove them with the "screen -wipe" command and something may have happened to your $PATH environment variable. Since you have your session data backed up with resurrect, try rebooting your system, and restore with "resurrect.sh -r 2" again.

by mbmmbm, 16 Nov 2011 07:06
mbmmbm 16 Nov 2011 06:46
in discussion Hidden / Per page discussions » Renumbering tmux Windows

I axed them :) Thanks for the kind words.

by mbmmbm, 16 Nov 2011 06:46
Philipp Keller (guest) 03 Nov 2011 09:34
in discussion Hidden / Per page discussions » Resurrecting GNU Screen Sessions After Reboot

Hi.

I'm using your resurrect script.
However, today after screen exited with "dungeon collapsing" I tried to resurrect an older version, but I get these error messages:

philipp@myserver:~$ ./resurrect.sh -r 2
pts-0:10::
Remove dead screens with 'screen -wipe'.
Remove dead screens with 'screen -wipe'.
./resurrect.sh: line 116: screen -S pts-0 -p 10 -X stuff cat: command not found
./resurrect.sh: line 118: screen -S pts-0 -p 10 -X stuff ssh: command not found
./resurrect.sh: line 121: screen -S pts-0 -p 10 -X stuff cd: command not found
pts-0:11::
Remove dead screens with 'screen -wipe'.
Remove dead screens with 'screen -wipe'.
./resurrect.sh: line 116: screen -S pts-0 -p 11 -X stuff cat: command not found
./resurrect.sh: line 118: screen -S pts-0 -p 11 -X stuff ssh: command not found
./resurrect.sh: line 121: screen -S pts-0 -p 11 -X stuff cd: command not found
pts-0:3::
Remove dead screens with 'screen -wipe'.
Remove dead screens with 'screen -wipe'.
./resurrect.sh: line 116: screen -S pts-0 -p 3 -X stuff cat: command not found
./resurrect.sh: line 118: screen -S pts-0 -p 3 -X stuff ssh: command not found
./resurrect.sh: line 121: screen -S pts-0 -p 3 -X stuff cd: command not found
pts-0:7::
Remove dead screens with 'screen -wipe'.
Remove dead screens with 'screen -wipe'.
./resurrect.sh: line 116: screen -S pts-0 -p 7 -X stuff cat: command not found
./resurrect.sh: line 118: screen -S pts-0 -p 7 -X stuff ssh: command not found
./resurrect.sh: line 121: screen -S pts-0 -p 7 -X stuff cd: command not found

Can you tell me what's wrong here? I have cat and ssh installed, of course.

by Philipp Keller (guest), 03 Nov 2011 09:34
Dan (guest) 18 Oct 2011 19:23
in discussion Hidden / Per page discussions » Renumbering tmux Windows

Unlike the two spambots above me, I really do appreciate this post. Thanks. :)

by Dan (guest), 18 Oct 2011 19:23
page 1 of 212next »
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License