10

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
                                                   ...V
                                        ............
                      ...................
                    ...
                    V
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?

719016
  • 4,337

2 Answers2

21

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.
Karolos
  • 2,614
  • In screen 4.00 it is confusing to use C-a :number x while in :windowlist. It works nicely when I am in a current widow and use quick list with C-a w then C-a :number x to switch the current window, for instance to the next or previous one to emulate @yoshikaw answer. – Joel.O Apr 13 '17 at 11:38
9

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)
yoshikaw
  • 1,496
  • 13
  • 10