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
sshand answers its startup cursor-position query.
StructsΒ§
- Console
Palette π - Bundle of the state colors
run_visuals_loopchooses between when repainting the per-client console.
EnumsΒ§
- Console
Paint π - A state repaint:
Tintswaps the console palette so the window background takes on the state color,Restorewrites 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
u32frame 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 theWelcome. - 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
clientsubcommand with API dependency injection. - paint_
console_ πcolor - Apply
targetif it differs fromlast, then updatelast. - paint_
steady π - Repaint the console to the steady-state look for
(state, highlighted). - read_
frame π - Receive until
pendingholds 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_receiverandhighlight_receiver, paint the steady-state combination, and flash the underlying state color forHIGHLIGHT_FLASH_DURATION. ANonebase(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
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 to clear it at.