GNU Screen

A veteran terminal multiplexer for detaching and resuming sessions

screen Shell and sessions GPL-3.0-or-later

About

GNU Screen was the original terminal multiplexer. Detach a session and return to it later, even after logging out. Lighter and more widely preinstalled than newer alternatives, it protects a long download or build from a flaky connection.

Install it

pkg install screen

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

5 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

screen -S build Start a new named session. Find and reattach to it by name later.
screen -r build Reattach to a session still running in the background after you disconnected.
screen -ls List the sessions that exist. Shows whether each is attached or detached.
screen -d -r build Force a detached session to reattach here. Rescues it when another terminal is stuck holding it open.
screen -dmS job build-all.sh Start a session detached and run a command inside it. The job keeps going after you close the terminal.

Developed by

GNU Project · released under GPL-3.0-or-later.