Module client
Expand description
Client implementation
StructsΒ§
- Console
Palette π - Bundle of the three colors
run_visuals_loopchooses between when repainting the per-client console.
EnumsΒ§
- Read
Write πResult - 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
clientsubcommand with API dependency injection. - paint_
console_ πcolor - Paint
targetif it differs fromlast, then updatelast. - 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_receiverandhighlight_receiver, paints the steady-state combination, and flashes the underlying state color forHIGHLIGHT_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
hoston its trailing:portsuffix (if any) and parses the port. An invalid:portis 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.