Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 20 windows open in my screen session, and I would like to reorder the right-most window 20 to say, just between positions 9 and 10 like this:

1 2 3 4 5 6 7 8 9      10 11 12 13 14 15 16 17 18 19 20
1 2 3 4 5 6 7 8 9  20  10 11 12 13 14 15 16 17 18 19

How can I do that in a single or few command/s?

share|improve this question
up vote 4 down vote accepted

I don't know how to reorder the window number using mouse. But in git version, window number can increase or decrease relative amount.

number [[+|-]n]

And in the windowlist, you can swap the window number using ,(previous) or .(next).

In your example, the following procedure would satisfy your wishes.

  1. select the window you want to move(select 20)
  2. switch into windowlist(windowlist)
  3. type , key 10 times
  4. (exit windowlist)
share|improve this answer
does this work for an existing screen session that I reconnected with the git version using 'screen -RD'? – 719016 Feb 1 '12 at 6:20
I think probably not. This feature require newer version both FRONTEND screen and BACKEND screen. – yoshikaw Feb 1 '12 at 7:20
This is what I thought. I'll start a new one with the git version once the one I have running needs to be closed... Thanks! – 719016 Feb 1 '12 at 12:58
Perfect answer.. worked like a charm. Just a hint.. to get the windowlist, press CTRL+a-" . – BTR Naidu Mar 30 at 10:37

The best I know of, is to re-number all your windows, like this:

C-a :number X

where C = ctrl, and X is the number your want for this window. In your case, this means that you need to move 20 -> 10, and 10 -> 20. Use a more complicated approach if you prefer.

From the man page:

  number [n]

   Change  the  current  windows  number. If the given number n is already
   used by another window, both windows  exchange  their  numbers.  If  no
   argument  is specified, the current window number (and title) is shown.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .