Module windows
Expand description
Re-exports the Windows API abstraction from cssh-rs-platform-windows.
Existing daemon and client modules import from crate::utils::windows;
the re-export preserves those paths while the implementation lives in
the platform crate.
Modules§
- api
- Windows API abstraction layer for console and system operations.
- traits
- Windows implementations of the
cssh-rs-platformtraits.
Structs§
- Console
Palette Snapshot - The console’s captured 16-entry palette plus its default text attribute
(kept so the tint can locate the default text/background entries in
color_table). - Default
Windows Api - Default implementation of WindowsApi that calls actual Windows APIs.
- Windows
Control Channel Client - Client-side control channel backed by a Windows named pipe client.
- Windows
Control Channel Server - Daemon-side control channel backed by a Windows named pipe server.
Constants§
- KEY_
EVENT - u16 representation of a KEY_EVENT.
- MAX_
WINDOW_ TITLE_ LENGTH - Maximum expected length of window title of a client window.
Traits§
- Windows
Api - Trait for Windows API operations to enable mocking in tests.
Functions§
- arrange_
console - Changes size and position of the current console window using the provided API.
- build_
command_ line - Build command line string for Windows process creation
- clear_
screen - Empties the console screen output buffer of the current console window using the provided API.
- control_
endpoint - Return the named-pipe path of the control channel owned by a daemon.
- get_
console_ input_ buffer - Returns a [HANDLE] to the [STD_INPUT_HANDLE] of the current process.
- get_
console_ output_ buffer - Returns a [HANDLE] to the [STD_OUTPUT_HANDLE] of the current process.
- get_
console_ title - Returns the title of the current console window using the provided API.
- is_
windows_ 10 - Detects if the current windows installation is Windows 10 or not using the provided API.
- read_
console_ input - Returns a single [INPUT_RECORD] read from the current process stdinput using the provided API.
- read_
keyboard_ input - Returns a single [INPUT_RECORD_0] where
EventType==KEY_EVENTusing the provided API. - set_
console_ border_ color - Sets the border color of the current console window using the provided APIs.
- set_
console_ color - Sets the back- and foreground color of the current console window using the provided API.
- set_
console_ palette - Installs
paletteas the console’s 16-entry color table, leaving the rest of the buffer info as it currently is, and forces a repaint. - snapshot_
console_ palette - Snapshots the console’s 16-entry RGB palette and default text attribute for a later restore and for locating the default foreground/background entries the tint recolors.
- tinted_
palette - Derive the tinted palette for a state color: the captured palette with the
console’s default-foreground and default-background entries remapped to the
colors the legacy
tintattribute’s foreground and background nibbles select. Recoloring palette entries (never the per-cell attributes) leaves VT/24-bit cells - which store their color outside the palette - untouched, so the full configured color applies without hiding the child’s own colored output. - utf16_
buffer_ to_ string - Converts a UTF-16 buffer to a Rust String, filtering out null characters.