screen — Detachable terminal multiplexer — sessions survive disconnects across all 5 shells
Equivalents in every shell
screen -S work`-S NAME` creates a NAMED session. Detach with `Ctrl-A d`; reattach with `screen -r work`. List sessions: `screen -ls`. The modern preferred alternative is `tmux`, which has better defaults, mouse support, and richer status bars — but `screen` remains pre-installed on more legacy systems.
screen -S workSame external `/usr/bin/screen`. macOS ships an OLD GNU screen (4.00.x) by default — `brew install screen` for a modern build. Prefix key is `Ctrl-A` by default (collides with bash's start-of-line); rebind in `~/.screenrc` with `escape ^Bb` to free `Ctrl-A`.
screen -S workSame external. Inside a fish session inside a screen window, scrollback uses `Ctrl-A [` to enter copy mode (then arrow keys + Enter to start/end selection). Screen also lets multiple users attach to the SAME session with `screen -x` — useful for pair-debugging.
Start-Job { long-cmd }No real `screen` equivalent on Windows. `Start-Job` runs a script block as a background job in the same pwsh session — `Get-Job`, `Receive-Job`, `Stop-Job` manage it. For a true detachable session, use Windows Terminal's tab persistence + a tmux/screen session inside WSL, or PSReadLine + `Start-Process` for separate processes.
# No native equivalent. Use Windows Terminal tabs + WSL screen/tmux.cmd has no concept of multiplexed sessions. For "long-running task with detach" on Windows, the closest is a Task Scheduler entry or a Windows Service. For interactive multiplexing, use Windows Terminal (`wt.exe`) tabs and run `screen` or `tmux` inside WSL.
Worked examples
Start a named session and detach from it
screen -S deploy # then Ctrl-A d to detachscreen -S deploy # then Ctrl-A d to detachReattach to a detached session
screen -r deployscreen -r deployList active screen sessions
screen -lsscreen -lsGotchas
- Screen's default prefix `Ctrl-A` collides with bash/zsh/readline's `Ctrl-A` (move to start of line). Either rebind in `~/.screenrc` (`escape ^Bb` makes the prefix `Ctrl-B`, same as tmux) or memorize the double-tap idiom `Ctrl-A a` to send a literal `Ctrl-A` to the inner shell.
- `screen -ls` may list DEAD sessions as `(Dead ???)` — clean them up with `screen -wipe`. Common cause: kernel SIGKILL of the screen process leaves the socket behind in `/var/run/screen/S-$USER/`.
- macOS's pre-installed `screen` (4.00.x) is YEARS OLD and is missing the `-Logfile` option, the `multiuser on` directive, and modern UTF-8 handling. Always `brew install screen` for a current build (5.x as of recent Homebrew).
- Screen's multi-user mode (`multiuser on` + `acladd USER`) is powerful for pair-debugging but is a security trap: any user in the ACL can run arbitrary commands as YOU. Audit `screen -x` access on shared hosts; tmux's `-S socket` + group permissions is the more controllable alternative.
- Windows has no equivalent inside the cmd or PowerShell process tree. The pragmatic Windows answer is "Windows Terminal tabs" for layout + "WSL with tmux" for detach/reattach. Native `Start-Job` and `Start-Process` give you SOME features but not session-resume-after-logoff.