Skip to main content

Module confirm

Module confirm 

Source
Expand description

Confirmation gating for the script WriteText command.

crate::protocol::strip_vt_sequences removes ESC-initiated sequences but deliberately passes printable characters and newlines, so a script holding allow_write_text can type a whole command line and submit it. Filtering cannot close that gap — the payload is ordinary text — so the control on this path is user confirmation, mirroring the trigger subsystem’s prompt_before_run.

The frontend queues the write onto the same pending-action queue the trigger dialog reads. The pieces that decide whether to queue, what id to queue it under, and how the text is shown live here so they can be tested without a window.

Constants§

MAX_PENDING_WRITE_TEXT_PROMPTS
Pending confirmations tolerated before a WriteText payload is dropped.

Functions§

describe_write_text
Render a sanitized WriteText payload for the confirmation dialog.
write_text_action_id
Synthetic confirmation id for a script WriteText payload.
write_text_needs_confirmation
Whether this payload must go to the confirmation dialog before it is written.