Skip to main content

Crate term_session

Crate term_session 

Source

Modules§

auto_spawn

Constants§

CHANNEL_ENV_VAR
DEFAULT_CHANNEL

Functions§

format_unix_relative
Format a unix timestamp as a relative human string (“2s ago”, “5m ago”, …), falling back to an absolute HH:MM:SS for very old timestamps.
kill_channel
Kill a channel’s session and detach all its sockets.
kill_client
Detach a single client socket from a channel by conn_id.
list_channels
List channels from the gateway, including the daemon PID + socket name.
resolve_channel
Resolve the channel from an optional CLI arg, falling back to the env var, then the default.
run_daemon
Run the gateway daemon: rename the process, detach from the controlling terminal, and serve until ShutdownGateway. selfcheck_marker is a test-only path written with the platform’s detachment proof once bound.
set_daemon_process_name
Rename the running process so process managers can distinguish the gateway daemon from interactive term-session clients. Best-effort and cosmetic: a failure is ignored and never affects functionality.
stop_gateway
Stop the gateway daemon.
with_gateway
Connect to the gateway daemon and run op with a live client. The tokio runtime that hosts the muxio connection is kept alive for the whole op, so RPCs complete (dropping it early would tear down the connection and hang the call). op receives an owned Arc and runs on that runtime.