5

Suppose that I have two screen sessions (screen_session_a and screen_session_b), both of which have several windows (window_1 to window_n).

The hierarchical layout looks like this:

+--+ screen_session_a
|  +- window_0
|  +- window_1
|  +- ..
|  +- window_n
|
+--+ screen_session_b
   +- window_0
   +- window_1
   +- ..
   +- window_n

I'm aware that switching between windows within the same session can be done efficiently with <CTRL> A-n, <CTRL> A-p, and so on. But now let's say I want to switch windows from different screen sessions, e.g. from screen_session_b/window_1 to screen_session_a/window_1.

At the moment I would do the following:

  • Detach from screen_session_b by hitting <CTRL> A-d
  • Attach screen_session_a with screen -r screen_session_a
  • If window_1 is not open yet, switch the window: <CTRL> A-' 1 <CR>

This is pretty cumbersome, especially if you need to to that very often. So I wondered if there is a more efficient way to switch between windows across different screen sessions?

  • On a side note: if screen can't help with that, maybe tmux will? I have not investigated this so this is just a suggestion. – Ghanima Sep 23 '14 at 14:27
  • (C-a C-a) -> "switch to the last window displayed" is not working across sessions? – Ghanima Sep 23 '14 at 14:41
  • 1
    @Ghanima unfortunately not. It just switches between the windows of the same session. – Michael Osl Sep 23 '14 at 14:51

Your Answer

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

Browse other questions tagged or ask your own question.