THE REVIEW BAR

See exactly what a paste carries - before it reaches the shell.

When text crossing the terminal boundary would carry unicode or control characters - a paste coming in, or a selection copied out - secure-terminal holds it and shows a review bar. No byte reaches the shell, or the clipboard, until you choose. It opens the text fully revealed - every hidden character named in place, nothing pre-dropped - names each one by class, tells you what accepting it would do, and lets you clear it before it crosses.

The paste review - a curl | bash line hiding two Cyrillic look-alikes (in example and bash), a zero-width space and a right-to-left override, opened fully revealed.
secure-terminal's in-window paste-review bar holding a hostile 'curl | bash' paste before any byte reaches the shell. A red dot and the summary 'This paste hides 1 bidirectional control, 1 invisible character, 2 non-ASCII characters.' head the bar, with a Restore original button, a safe-green Reject button and a red, disabled 'Paste blocked - 2 hidden' button top-right. The ONE editable box opens fully revealed: nothing is dropped, so the two Cyrillic look-alikes are highlighted and named inline as U+0430 CYRILLIC SMALL LETTER A, and the invisible and the reordering override are shown in place as named badges, U+200B ZERO WIDTH SPACE and U+202E RIGHT-TO-LEFT OVERRIDE. A status line reads 'Showing the full paste - 2 hidden characters block sending; each is named in the box. Remove them to continue.' Under a 'Text transformations:' heading, Strip unicode, ASCII-fold and Keep printable unicode buttons each carry a plain-language gloss. A Structure section lists 1 line, an 'If accepted: waits on the command line - press Enter to run' guarantee and a 65-character length; a live per-class Hidden-characters table names Bidirectional control 1, Invisible / zero-width 1 and Look-alike (homoglyph) 2, every other class 0.
The same bar for a copy - the "If accepted" row is present here too, and reads placed on the system clipboard (nothing runs).
secure-terminal's review bar reviewing a copy going out to the system clipboard. The summary reads 'This copy would carry 1 bidirectional control, 1 invisible character, 2 non-ASCII characters onto the clipboard.' It is the same fully-revealed single-box layout as the paste bar, with Strip unicode / ASCII-fold / Keep printable unicode transforms and a Structure section whose 'If accepted' guarantee reads 'placed on the system clipboard (nothing runs)'. The reject button reads Don't copy and the Copy button is disabled and red, 'Copy blocked - 2 hidden'; there is no countdown, since a copy is not executed.
Reproduce this · put a hostile paste on the clipboard and Ctrl-Shift-V into secure-terminal - the bar holds it; copyable commands are on the screenshots and comparison pages.

When it appears

The bar is not a modal you dismiss on every paste. It appears only when there is something worth a second look.

By default (paste_warn=unicode, copy_warn=unicode) the bar appears when the text carries any non-ASCII or control character - the case a Trojan-Source or pastejacking payload needs. A multi-line paste is held too, even when it is pure ASCII, because a hidden second line could otherwise run the instant you paste. You can set either direction to always (review every paste or copy) or never (sanitize silently, no bar). While the bar is up, input to the child is suspended: nothing crosses until you Reject or clear the hidden characters and deliver.

The hidden-character breakdown

A one-line summary tells you the headline; a table names every class present, counts it, and shows what is not present too - so "nothing else is hiding" is explicit, not assumed. Each class is tinted by the same risk colour the terminal draws it in.

ClassWhat it isExample
↔Bidirectional controlreorders the visible text (Trojan-Source)
␀Control characterC0 / DEL / C1 bytes
␣Invisible / zero-widthjoins or hides characters you cannot see
≈Look-alike (homoglyph)a Cyrillic letter posing as its ASCII twin
◌Combining (Zalgo)stacked accents piled on a base letter
┼Box-drawing / blockshonest line-drawing glyphs, low risk
ÀOther non-ASCIIordinary foreign or accented text

The summary folds these into a short sentence ("hides 1 bidirectional control, 1 invisible character"); the table is the full, copyable detail, and it recomputes live from the box on every edit. The box itself renders the text fully revealed - each look-alike tinted and named inline, every invisible or reordering character shown in place as a named badge - so a look-alike command cannot hide behind a plain-text field, and the ASCII-fold button de-obfuscates it to its real ASCII before you send it.

Structure, and the "If accepted" guarantee

Beyond the characters, the bar summarises the shape of the text - and tells you, on an "If accepted" row that is always present, exactly what accepting it would do.

  • Lines - how many commands it would be; a multi-line paste is flagged, because each line is a command.
  • ✓ If accepted - shown in every direction, so the guarantee never appears and disappears as you switch between pasting and copying. What it says depends on where the bytes would land:
    • Paste at a shell prompt - the trailing submit byte is removed, so the command waits on the command line for your own Enter. It never runs on its own.
    • Paste into a full-screen program that asked for bracketed paste (DEC 2004) - the program receives the text as inert data, not keystrokes.
    • Paste into a program running in raw mode with no bracketed paste (an editor in insert mode, a raw-key REPL) - there is no command line to wait at, so the row says, in amber, that the program receives it immediately as keystrokes. It still never auto-runs a shell command (the trailing submit is gone), but the row does not pretend an Enter is waiting - it tells you the honest truth for that case.
    • Copy or clipboard - the text is placed as clipboard data, and nothing runs.
  • Length - characters and bytes (marked as a scanned prefix when a very large paste is only partly scanned, so a capped count is never shown as a definite total).

Revealed first, then editable

The box opens fully revealed - nothing is silently pre-dropped, so a trap cannot hide by being cleaned away before you preview it. You clear it deliberately.

Every hidden character stays in place, named and risk-coloured. While any invisible, reordering or control character remains, the deliver button is disabled and red ("blocked - N hidden"), so nothing unreviewed can cross. You clear it with one of three labelled transforms - Strip unicode (delete every non-ASCII character), ASCII-fold (replace each look-alike with the plain letter it imitates) or Keep printable unicode (drop the invisible/reordering characters, keep the rest) - or by editing the box directly; the summary, the breakdown and the box all recompute from what you typed. Restore original re-reveals the untouched text at any time. Delivery then enables and sends exactly the box - still run through the same sanitizer on the way out, so an edit can never bypass the neutralization. What the box shows is what crosses.

Paste and copy are not symmetric - by design

You may notice a copy raise the bar while pasting the same text back does not. That is correct, not a bug.

A paste is inspected as the raw clipboard bytes, in every display mode. A Ctrl+C copy is inspected as the on-screen selection. In the box, reveal and detail display modes the selection is already sanitized to ASCII, so nothing risky can reach the clipboard and no review is needed; only in show mode, where real glyphs are kept, does a copy raise the bar. A mouse selection (the X11 primary buffer) and drag-and-drop are always hard-stripped to ASCII, so a middle-click paste of a selection is safe without a review.

So when a copy raises the bar but pasting the same text back does not, it is because what reached the clipboard was already safe - the terminal reviewed the risky direction and left the harmless one alone.