Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I obtain information (title, created time, visible content) about windows in a screen session? I need to do this in a script, so I am not looking for key bindings or interactive commands.

Something like tmux's list-windows would be great.

share|improve this question
up vote 5 down vote accepted

According to this thread in screen-users such a functionality has been implemented in screen. Apparently I don't have a recent enough version for it to work but this should work in recent versions of screen. [Edit] I just tried with the latest git, it work even if it's not documented in screen -h

screen -Q windows
screen -Q select my_window

The first appearance of the -Q option was in this commit.

share|improve this answer

Try the sequence Ctrl-a w per the instructions here.

Personally, I use a .screenrc file that keeps this information on the bottom of the screen at all times (like a Windows task bar). My screen config (~/.screenrc) looks like:

hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
share|improve this answer
Thank you, that is nice. But as I said in the question I am not looking for a key binding. I need to get the window name and other information from a bash script. – abcd Aug 20 '12 at 17:12
You're right, I misread your question. I'll do some research and post back if I find anything. – bobmagoo Aug 20 '12 at 17:22

In GNU Screen the default key binding to get a list of all the windows (and choose one to switch to) is:

C-a "
share|improve this answer

Your Answer


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.