Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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

share|improve this answer
    
This works nice. thanks. –  Shavi Nov 2 at 20:13

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
share|improve this answer
    
I tried typing ":" but that just goes to the program that is running in the screen (vi command prompt eg) –  Shavi Nov 2 at 20:18
    
Sorry I see first Ctrl-B –  Shavi Nov 2 at 20:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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