115

I learned to use gnu-screen and have been using it for the past several weeks. I got a grip of the basics now, and would be very helpful if I get these queries clarified:

  1. How do I rename / reorder / move windows in Linux screen utility?

    For eg., after a few days of use, I come to a state where the window-numbers are 2, 3, 6, 8. Now I want a new-window to be created at #9, or #7. Is this possible? If yes, how?

    Also, is it possible to 'move' the window #6 to #4 or #7? If yes, how?

  2. Scrolling shortcut: Scroll takes Ctrl-A + Esc, and then Ctrl-u / Ctrl-d. Is there a way to map PgUp / PgDn to do these directly? Or, is there a way to map some key (like F5) to take me to copy mode, and then PgUp / PgDn for scrolling?

  3. I have enabled "caption always", so the current window title is displayed always at the bottom. Is there a way to display the current window's log-file-name and logging status (on/off) in the same caption bar?

8
  • 37
    :number X moves window to specific position
    – Ency
    Mar 7, 2011 at 18:08
  • Check this out hardstatus string "%{.kG}%-Lw%{.KW}%n%f %t%{-}%+Lw %=%{..G} %H %{..W} %d/%m %C%a " it provides a lot of information (Z$L..) for all windows at time
    – Ency
    Mar 7, 2011 at 20:52
  • Ency : thanks for the hardstatus string tip. It shows lot of details, but not the logfile name and status info. Any idea on this ?
    – Rangzy
    Mar 8, 2011 at 8:50
  • 1
    That's not true, in screen do ctrl+A ctrl+| for a vertical split Aug 14, 2012 at 0:51
  • 1
    @NickGarvey the vertical split patch for screen is not in GNU Screen. It is a patch that is applied by some distros. Aug 14, 2012 at 1:18

2 Answers 2

152

You can renumber the current window with ctrl+a :number x where x is a numeric argument.

You can rename the current window with ctrl+a A

4
  • 14
    Renumbering even works if the new number is already in use. In this case the windows exchange their numbers. Nice.
    – Uwe Geuder
    Dec 17, 2012 at 14:16
  • 5
    I was a little confused at first. You have to type the literal string "number" and x is the kind of parameter to the number renaming function.
    – rrenaud
    Sep 6, 2014 at 21:10
  • 3
    More symetrically and easier to remember you can do: ctrl+a :title new window title
    – Wadih M.
    Feb 14, 2016 at 1:27
  • @WadihM. just so long as there's no spaces in the new_window_title
    – 22degrees
    Mar 31, 2016 at 21:08
47

You can move windows up and down with this:

ctrl+a :windowlist then . (dot)-down and , (comma)-up

or

ctrl+a " then . (dot)-down and , (comma)-up

(From here.)

3
  • 15
    Adding to weinerk's answer, you can show list of windows by ctrl+a " Jan 4, 2017 at 8:37
  • 4
    :windowlist is way more useful than :number when doing a big cleanup / reorganisation. Jun 27, 2017 at 10:39
  • Another somewhat relevant feature for ease of navigation - you can name/rename each window: ctrl+a A or ctrl+a :title
    – weinerk
    Apr 5, 2020 at 14:35

You must log in to answer this question.

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