4

I am using tmux after logging into our university server. I have multiple screens (created with Ctrl-B c), some for editing different files. Some for running programs. I go through the tasks with Ctrl-B n and Ctrl-B p, but sometimes this takes long to find the right one.

Is there a shortcut to a screen running some specific program. Or is there some other way to manage the screens (sometimes ten or more)?

5

You can get a list of "screens" with Ctrl+B w. This shows the main program running without any options, so that help a bit but not much.
You should name your screens with Ctrl+B , after you make them, that will make that list much more useful.

This is what I get after Ctrl+B w, you can select the entry with and followed by Return, or by clicking with the mouse.

enter image description here

3

See the list-windows option in the man page:

list-windows [-a] [-F format] [-t target-session]
(alias: lsw)
If -a is given, list all windows on the server. Otherwise, list windows in the current session or in target-session. For the meaning of the -F flag, see the FORMATS section.

From within tmux, open a command line with : and then issue the command:list-windows to see a list:

0: TTYtter  (1 panes) [142x60] [layout b07d,142x60,0,0,0] @0
1: NZOSA  (1 panes) [142x60] [layout b07e,142x60,0,0,1] @1
2: SSH  (1 panes) [142x60] [layout b07f,142x60,0,0,2] @2
3: IRC  (1 panes) [142x60] [layout b080,142x60,0,0,3] @3
4: Shell- (1 panes) [142x60] [layout b081,142x60,0,0,4] @4
5: bash* (1 panes) [142x60] [layout b082,142x60,0,0,5] @5 (active)

If you use this command frequesntly, bind it to a key to make it more convenient to run:

bind-key C-w list-windows
  • I tried typing ":" but that just goes to the program that is running in the screen (vi command prompt eg) – Shavi Nov 2 '14 at 20:18
  • Sorry I see first Ctrl-B – Shavi Nov 2 '14 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.