GNU Screen Tutorial: Sessions, Windows and Detached Programs
Screen manages terminal sessions containing windows and their programs. Detaching removes the current interactive connection while the session can continue, whereas terminating a program ends its execution. This distinction is useful for remote work, where a lost terminal connection and a finished command are not the same event.
Here's a popular GNU Screen video — watch it, then summarize it with one click. Or paste any other YouTube link below.
— or paste your own YouTube link —
Want to keep the key points from a YouTube video? Paste the link below to turn it into structured notes.
Why Use GNU Screen Tutorial: Sessions, Windows and Detached Programs
- Distinguish sessions from their windows
- Understand detach and reattach behavior
- Identify the program active in a window
- Separate connection loss from execution completion
- Recognize session lifetime and cleanup
Frequently Asked Questions
Does detaching terminate the command in a window?
Detaching removes the user's current attachment to the Screen session. The program can continue under that session, so detachment should not be interpreted as a command's normal completion or cancellation.
How does a window differ from a session?
A session is the managed Screen context that can contain several windows. Each window provides a terminal environment for a program, making window selection different from choosing another independent session.
Why identify the session before reattaching?
Several sessions can exist for different tasks. Identifying the intended session avoids returning to an unrelated program and clarifies which execution context and output are being inspected.
Does a persistent terminal replace application recovery handling?
A persistent terminal helps preserve an interactive execution context, but application errors and host failures remain separate. The program still needs appropriate data and recovery behavior for its actual workload.
What should be checked when remote work finishes?
Check the program's outcome and whether any session or window still needs to remain active. Finishing an interactive attachment does not automatically establish that all associated commands have ended.