Skip to main content

Module client

Module client 

Expand description

Client implementation

StructsΒ§

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

EnumsΒ§

ReadWriteResult πŸ”’
Possible results when reading from the named pipe and writing to the current process’s stdinput.

ConstantsΒ§

HIGHLIGHT_FLASH_DURATION πŸ”’
Duration of the action-feedback flash painted on a highlighted client when the user toggles the state.

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.
capture_original_console_color πŸ”’
Snapshot the current console color.
get_effective_color πŸ”’
Resolve the console color for a (state, highlighted) combination; highlight overlays the disabled color.
get_flash_color πŸ”’
Resolve the underlying state color, with the highlight overlay bypassed, for the action-feedback flash.
is_alt_shift_c_combination πŸ”’
Checks if a key event represents the Alt+Shift+C combination.
launch_ssh_process πŸ”’
Launch the SSH process.
main
The entrypoint for the client subcommand with API dependency injection.
paint_console_color πŸ”’
Paint target if it differs from last, then update last.
paint_steady πŸ”’
Repaint the console to the steady-state color for (state, highlighted).
read_write_loop πŸ”’
Read all available daemon-to-client messages from the named pipe and apply them.
replace_argument_placeholders πŸ”’
Replaces placeholders in SSH command arguments.
resolve_username πŸ”’
Resolve the username from the provided value or SSH config.
run πŸ”’
The main run loop of the client.
run_title_loop πŸ”’
Keeps the console window title pinned to console_title, since the SSH child can overwrite it on connect.
run_visuals_loop πŸ”’
Drives the per-client console color: tracks state_receiver and highlight_receiver, paints the steady-state combination, and flashes the underlying state color for HIGHLIGHT_FLASH_DURATION.
send_pid_handshake πŸ”’
Send this process’s id over the pipe to the daemon as a 4 byte little-endian sequence.
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 at which the steady-state should be restored.
write_console_input πŸ”’
Write the given [INPUT_RECORD_0] to the console input buffer using the provided API.