abduco
Detach and reattach terminal sessions
TLDR
List sessions
[A]ttach to a session, creating it if it doesn't exist
[A]ttach to a session with dvtm, creating it if it doesn't exist
Detach from a session
[A]ttach to a session in [r]ead-only mode
SYNOPSIS
abduco [options] [command [arg ...]]
Common usage examples:
abduco -l
abduco -n session_name [command [arg ...]]
abduco -a session_name
abduco -A session_name [command [arg ...]]
abduco -d session_name
abduco -x session_name
PARAMETERS
-r
Reattach to a session if it exists. If not, it will typically exit.
-c
Create a new session if the specified session does not exist. If it does, it will typically exit.
-A
(Auto) Reattach to a session if it exists, otherwise create a new one. Equivalent to abduco -rc.
-l
List all currently active abduco sessions.
-a
Attach to the specified session.
-e
Execute cmd inside the attached session (requires -a).
-n
Create a new session named session. If command is provided, it runs that command; otherwise, it starts a shell.
-d
Detach (disconnect) from the specified session.
-x
Kill (terminate) the specified session and all processes running within it.
-q
Query the status of the specified session (e.g., whether it's attached or detached).
-k
Disconnect (kick) any attached client from the specified session, but leave the session running.
-s
Execute a shell within the specified session (requires -a).
DESCRIPTION
Abduco is a minimal and efficient session manager for terminal programs, designed with the
suckless philosophy of simplicity and conciseness in mind. It allows users to
detach running programs from their controlling terminal, letting them continue to
execute in the background, and then reattach to them later from the same or a different
terminal. Unlike more feature-rich multiplexers like GNU Screen or tmux,
abduco focuses solely on session detachment and reattachment, providing a
straightforward and lightweight solution for persistent terminal sessions. It leverages
the underlying dtach utility for its core detachment functionality. This design makes
abduco ideal for users who prefer a minimalist approach and do not require
features such as multiple windows, panes, or extensive scrollback buffers built into the
session manager itself. It's particularly useful for keeping long-running processes
alive across network disconnections or when switching between different terminal
emulators.
CAVEATS
Abduco's minimalist design means it lacks many features found in more complex terminal
multiplexers. It does not provide built-in support for multiple windows, panes,
scrollback buffers, or extensive customization options. Its session files are by default
created in the current working directory, which means sessions are context-dependent
unless an absolute path for the session file is specified. The underlying detachment
mechanism relies on dtach, which handles the core process management, and any limitations
or behaviors of dtach can indirectly affect abduco.
<I>SESSION PERSISTENCE & SHARING</I>
Abduco sessions provide persistence for programs. A session, once created, continues
to run even after the client terminal detaches or closes. This means long-running tasks
like compilations or server processes can be started and left to run independently.
Furthermore, multiple clients can attach to the same abduco session concurrently,
allowing for shared terminal sessions, which can be useful for collaborative work or
demonstrations where several users need to view the same terminal output and interact
with the same process.
<I>UNDERLYING MECHANISM</I>
Abduco internally utilizes the dtach utility, which provides the core functionality
for detaching and attaching processes from controlling terminals. When a new abduco
session is created, abduco essentially wraps dtach, setting up a socket or named pipe
in the background. This socket serves as the communication channel between the
detached process and any future attaching clients. When a client attaches, it connects
to this socket, and all terminal I/O is redirected through it. Detaching simply means
disconnecting from this socket while the underlying process managed by dtach continues
to run. This design choice offloads the complex task of terminal emulation and process
management to a dedicated, proven utility, allowing abduco to remain small and focused
on its session management role.
HISTORY
Abduco is part of the
suckless.org project, which advocates for software that is simple, secure, and
small. It was developed to provide a lightweight alternative to existing terminal
multiplexers, adhering strictly to the Unix philosophy of doing one thing and doing it
well. Its development focuses on code clarity and minimal dependencies, building upon
the established dtach utility rather than reimplementing core process detachment. This
approach reflects a commitment to simplicity and efficiency in terminal session
management.