Giving it two inputs
Four ways in, one destination. Drop, browse or paste; the drop zones never learn which route an input arrived by, and neither does the engine that compares it.
Every route in#
| Route | Keys | What it does |
|---|---|---|
| Drag and drop | — | Drops a file, folder or image onto one zone |
| File picker | ⌘O | Opens twice: BEFORE, then AFTER |
| Folder picker | ⌘⇧O | The same, for directories |
| Per-zone buttons | — | Browse file… and Folder… fill just that one side |
| Clipboard | ⌘V or ⌘⇧V | Reads the system clipboard into the empty side |
| Swap | ⌘⇧S | Exchanges the two sides |
All of them converge on one function that sets one side's input. Nothing downstream — detection, the engine, the view, export — can tell how an input arrived.
A filled zone shows the name, the size, the kind TwinScope decided it is, and the first four lines of the content, so you can see at a glance that you dropped the right thing.
Drag and drop#
Drop anything onto BEFORE or AFTER. The zone highlights while a drag is over it and says Release to compare.
| Case | Behaviour |
|---|---|
| One file or folder | Read, detected and loaded into that zone |
| Several files at once | Only the first is used. A zone holds one input, and silently choosing one of five would be worse than ignoring four |
| A text selection dragged from another app | Becomes an input named dropped-a.txt or dropped-b.txt |
| A drag carrying only whitespace | Ignored — an accidental drag leaves the zone as it was |
The native pickers#
⌘O opens the file picker twice, in sequence — its title reads Choose the BEFORE file, then Choose the AFTER file. Two native dialogs at once is a mess, and the order the titles promise is the order you are already reading in.
- Cancelling the first dialog stops there and changes nothing.
- Cancelling the second leaves BEFORE filled and AFTER empty.
- The Browse file… and Folder… buttons inside a zone open a single dialog for that side only.
⌘⇧O is the same flow for directories, which is how a folder comparison starts.
The clipboard#
This is the route that makes TwinScope worth leaving open: copy, paste, copy again, paste again, read.
| Key | When it works |
|---|---|
| ⌘⇧V | Always |
| ⌘V | When you are not typing into a field |
Plain ⌘V is handled as a paste event rather than as a key binding, which lets the
platform decide what counts as a paste — so it keeps working inside every text field, and OS
variants come along for free. If the paste target is an input, a textarea or anything
content-editable, the field gets the paste and the comparison is left alone.
| Clipboard holds | Result |
|---|---|
| Text | An input named clipboard-a.txt, or clipboard-a.json when the content parses as JSON. The kind comes from the content, never from that name |
| An image | An input named clipboard-a.png, with its pixel dimensions shown in the zone |
| Nothing, or only whitespace | Nothing happens |
Pastes fill A first, then B. A third paste replaces BEFORE, which is what a third paste almost always means.
Swapping sides#
⌘⇧S, or the ⇄ button between the two zones. Before becomes after.
With a comparison already open, swapping re-runs it the other way round rather than dumping you into an empty workspace — and the engine options you had set survive the swap, because they describe the request rather than the reply.
Changing an input clears the result#
Setting either side clears any finished comparison, along with the options that belonged to it and any drill-in you were inside.
That is deliberate: a stale diff shown against new inputs is worse than no diff at all. A new input may also mean a different engine entirely, whose options have nothing to do with the previous one's.
Large inputs#
| Size | What travels |
|---|---|
| Up to 10 MB | Main reads the text once so the zone can preview it, and the content travels with the input |
| Over 10 MB | Only the path. The zone reads read on demand, and the engine worker opens the file itself |
| Images | Read as bytes for the in-window image engine, which refuses anything over 64 MB with a message naming the file and its size |
Multi-megabyte strings never cross the IPC boundary. Above 10 MB a text comparison also asks for confirmation before it starts — see Running a comparison.