Long-running commands inside Screen can finish, fail, or print important status while another window is selected. Activity monitoring makes Screen show a message for a watched background window as soon as new output appears there.

The default C-a M binding runs Screen's monitor command for the current window. Monitoring is per window and off by default, so enabling it on one build or log window does not turn it on for every other window in the session.

The activity notice appears only after the monitored window is in the background. Use the message line and the @ marker in the window list as the proof that Screen noticed output from the watched window.

Steps to enable Screen activity monitoring:

  1. Attach to the Screen session and select the window that should be watched.
    $ screen -r work
    C-a 1

    Replace work with the session name shown by screen -ls and 1 with the target window number or title.

  2. Enable activity monitoring for the selected window.
    C-a M
    Window 1 (build) is now being monitored for all activity.

    The default C-a M binding runs Screen's monitor command for the current window.

  3. Switch to a different window so the monitored one becomes a background window.
    C-a 0

    Screen reports activity only after the monitored window is no longer selected.

  4. Wait for the background command to print output, or produce a small test line in that window.
    Activity in window 1

    The message appears on Screen's message line when the watched background window produces new output.

  5. Check the window list if the message disappears before it can be read.
    C-a w
    0* shell  1-@ build

    The @ marker beside build confirms that Screen recorded activity in that monitored window.

  6. Enable monitoring from another terminal when the session is detached or an explicit command is clearer than a toggle.
    $ screen -S work -p build -X monitor on

    The -p build selector chooses the target window before sending monitor on. The command is normally silent in the shell that sends it, so verify the next background-output notice in the attached session.

  7. Make activity monitoring the default for new windows only when most background jobs should be watched.
    $ vi ~/.screenrc
    defmonitor on
    activity "Activity in window %n (%t)"

    defmonitor on affects windows created after the config is loaded. The activity line customizes the message; remove it to use Screen's default.

  8. Disable monitoring again when the watched window becomes noisy.
    C-a M
    $ screen -S work -p build -X monitor off

    Use the same interactive toggle for the selected window, or use the explicit external command when targeting the window by title.