Expand description
Platform abstraction layer for par-term.
This module centralises the platform-specific behaviour that would otherwise be
scattered across the codebase as inline #[cfg(target_os = ...)] blocks.
§Conventions
- Every public function in this module has a single, consistent cross-platform signature. The platform branching is contained inside each function body.
- Consumers import
crate::platformand call the function directly — no#[cfg]attributes are required at the call site.
§Contents
| Function | Description |
|---|---|
deliver_desktop_notification | Send a native desktop notification |
deliver_desktop_notification_request | Send a notification with identity/click-token support |
drain_notification_clicks | Non-blocking drain of notification click tokens |
primary_modifier | Whether the platform’s “primary” modifier key is held |
Structs§
- Notification
Request - Parameters for delivering a desktop notification.
Enums§
- Notification
Urgency - Notification urgency level, local to the platform layer so this module has no dependency on any particular terminal library’s urgency type. Callers map their own urgency representation onto this at the call site.
Functions§
- deliver_
desktop_ notification - Deliver a native desktop notification.
- deliver_
desktop_ notification_ request - Deliver a native desktop notification, with optional identity (replacement) and click-token association. See the module docs for the per-platform support matrix.
- drain_
notification_ clicks - Non-blocking drain of click tokens emitted by notification backends. Safe to call every frame from the event loop.
- escape_
for_ applescript - Escape a string for safe embedding inside an AppleScript double-quoted string.
- primary_
modifier - Returns
truewhen only the platform’s primary modifier key is held (no Shift, no Alt, and no cross modifier), i.e.: - primary_
modifier_ with_ shift - Returns
truewhen the platform’s primary modifier key and Shift are held, and no other modifiers are held, i.e.: