DGC v0.51.0 is out
Navigate
Install DGC
DGC v0.51.0Edit on GitHub ↗
Using DGC/Pasted text

a tall paste, a pasted link, a paste's shape, and characters you cannot see

Pasted text

#

A paste is not typing. It can be forty lines of log, a bare URL, a whole file, a list copied from a web page, or text carrying characters that have no glyph at all. DGC keeps the shape it was copied with, takes out what you cannot see, and leaves everything you can see as it was.

A tall paste folds

#

In the terminal, a paste of five lines or more — or over 600 characters — collapses to a chip in the composer, [Pasted text #1 +40 lines], so a forty-line paste no longer takes half the screen. It expands back to the full text the moment you send. A shorter paste inserts as typed, and a field prompt that wants one exact value (a URL, a session name) always takes the whole text.

In the editor, a paste of 5,000 characters or more becomes an attachment chip reading Pasted text · 12,480 chars instead of filling the composer. Click it to read what it holds. Whatever you had already typed stays where it was.

#

In the editor, a clipboard holding exactly one URL and nothing else inserts a pill showing the host and path — github.com/OpenPeach-ai/dgc — with the whole URL on its tooltip. What the model receives is the URL itself, character for character: the pill shows the link, it does not replace it. Nothing is fetched to draw it, not even a favicon, so pasting a link discloses it to nobody. A paragraph that happens to contain a URL is prose, and is pasted as prose.

A paste keeps its shape

#

Line breaks, blank lines, indentation, tabs and runs of spaces all stay, in the box, in what the model receives and in the message you see once it is sent. Only the blank lines around a whole message go. Its first line keeps its indentation, so a pasted block arrives in step with itself.

A browser's plain text is not what was on the page. Chrome copies a numbered list without its numbers and a nested list without its nesting, though the same copy's HTML still has them. In the editor's prompt boxes, DGC puts them back from that HTML as plain text: 1., 2., a. and -, indented as they were nested, starting where the list says it starts. Every other character comes from the plain text. A list whose items cannot all be found in the plain text stays as the plain text has it. An application that writes the numbers itself (Firefox, Safari, Word, LibreOffice) is left alone. A selection that begins partway down a list is numbered from the list's start, because the clipboard does not say where it began.

The terminal only ever receives a paste as plain text, so it keeps everything that text holds, but a number the browser already dropped cannot be recovered there.

Characters you cannot see are removed as they land

#

Three kinds of invisible character can hide an instruction inside text that looks ordinary:

  • Bidirectional overrides reorder how text displays without changing its bytes, so what you read and what the model reads can differ.
  • Tag characters encode a whole line of ASCII inside something that renders as nothing at all.
  • Zero-width characters pad text invisibly. Byte order marks, soft hyphens and control characters go with them.

DGC hands your draft to a model and then acts on it, so this is a way in rather than untidiness. A paste, or text dragged into the box, is cleaned before it lands, and a quiet row above the box says Removed 3 invisible characters from the pasted text. Hover over it to see which kinds. Close it if you like; it goes by itself when you send or clear the draft. If you wanted them, one undo brings the paste back exactly as it was copied, and a second takes the paste away. A paste large enough to fold into a chip is cleaned too, because the chip's text is what reaches the model. Work, ChatDGC and a Pip's chat all behave this way.

In the terminal the classic prompt and the full-screen prompt do the same, with a short dim line saying so.

Text you type stays as you typed it, and nothing is said about it. Dictated text loses any invisible character the speech model produced, without a notice, because nobody can say one.

Ordinary text is left alone. Arabic, Persian and Hebrew carry directional marks as a matter of course, every multi-person emoji is held together by zero-width joiners, Indic and Persian words use them too, and the three subdivision flags are built from tag characters. None of those are touched, and none raise the row. Visible characters, in code or anywhere else, come through byte for byte.

The editor never pastes markup

#

The composer is an editing host, which means the browser would otherwise insert your clipboard's HTML into it rather than its text. DGC only ever puts text in, on every path, and reads the HTML for nothing but the list markers above — so a copied web page cannot bring an image that calls home the instant you paste, or an element laid over the Send button.

Documentation