Skip to main content

Module client

Module client 

Expand description

Client implementation

ModulesΒ§

console_mode πŸ”’
RAII guard for the console modes the ConPTY client needs.
dispatch πŸ”’
Application of daemon-to-client messages.
input_bytes πŸ”’
Encoding of keystrokes into the terminal bytes written to the PTY master.
pty πŸ”’
ConPTY that runs ssh and answers its startup cursor-position query.

StructsΒ§

ConsolePalette πŸ”’
Bundle of the state colors run_visuals_loop chooses between when repainting the per-client console.

EnumsΒ§

ConsolePaint πŸ”’
A state repaint: Tint swaps the console palette so the window background takes on the state color, Restore writes the saved palette back.

ConstantsΒ§

HIGHLIGHT_FLASH_DURATION πŸ”’
Duration of the action-feedback flash painted on a highlighted client when the user toggles the state.
LENGTH_PREFIX_LEN πŸ”’
Length in bytes of the big-endian u32 frame length prefix.

FunctionsΒ§

build_console_title πŸ”’
Builds the console window title shown to the user.
build_ssh_arguments πŸ”’
Build the SSH arguments from the username, host, port, and config.
client_handshake πŸ”’
Exchange Hellos and receive the Welcome.
connect_with_retry πŸ”’
Connect to the daemon control channel, retrying while the daemon binds it.
get_effective_color πŸ”’
Resolve the steady-state paint intent for (state, highlighted); the highlight overlays the disabled color.
get_flash_color πŸ”’
Resolve the flash paint intent for state, bypassing the highlight overlay.
main
The entrypoint for the client subcommand with API dependency injection.
paint_console_color πŸ”’
Apply target if it differs from last, then update last.
paint_steady πŸ”’
Repaint the console to the steady-state look for (state, highlighted).
read_frame πŸ”’
Receive until pending holds a complete frame, then split it off.
read_message πŸ”’
Read one frame and decode it as T.
replace_argument_placeholders πŸ”’
Replaces placeholders in SSH command arguments.
resolve_username πŸ”’
Resolve the username from the provided value or SSH config.
run_control_channel πŸ”’
Dispatch daemon messages until the daemon terminates or disconnects, or the SSH child exits.
run_title_loop πŸ”’
Keeps the console window title pinned to console_title, since the SSH child can overwrite it on connect.
run_visuals_loop πŸ”’
Drive the per-client console color: track state_receiver and highlight_receiver, paint the steady-state combination, and flash the underlying state color for HIGHLIGHT_FLASH_DURATION. A None base (the palette could not be read) degrades all painting to a no-op.
spawn_local_input πŸ”’
Forward this window’s own keystrokes to the PTY master from a dedicated thread, so a broadcast line stays editable here, and resize the PTY with the console window.
spawn_output_reader πŸ”’
Render the PTY output to this window from a dedicated thread.
split_host_and_inline_port πŸ”’
Splits host on its trailing :port suffix (if any) and parses the port. An invalid :port is logged and treated as absent so the CLI port can still apply.
start_flash πŸ”’
Paint the action-feedback flash and return the deadline to clear it at.