In screen is there a way to put a window in between 2 others instead of swapping?
Here is what I have
1 - I want this to become #2
2 - I want this to become #3
3 - I want this to become #1
If I go to screen #3 and enter the command ":number 1", the new order is
1 - I want this to become #1
2 - I want this to become #3
3 - I want this to become #2
Obviously with one more command, I can get what I want. However, when I have 15 windows it is a major pain.
There seems to be no single screen command to do it. However I came up with this script, that can do it by executing enough
number
commands in a row to do it:This can be run from any window within the screen and takes two arguments, the source and destination number of a window to be moved. The source or destination window can match your current window number.
I could find no way to query screen about active and existing window numbers from a script. So I could not make the script default to moving the active window.