Clipboard
The shared buffer behind cut, copy, and paste, invented at Xerox PARC, which offers data in several formats at once and has become a channel for snooping and for commands that paste differently from how they looked.
The clipboard is the temporary storage behind cut, copy, and paste. Larry Tesler and Tim Mott developed the commands for the Gypsy word processor at Xerox PARC in the mid-1970s, and the Apple Lisa and Macintosh made them, with their one-letter keyboard shortcuts, standard across every program; see Direct Manipulation.
Copying usually doesn't copy one thing. The source program offers the data in several formats at once, such as rich text, HTML, and plain text for a selection in a document, and the program receiving the paste picks the richest one it understands. That's why pasting into a plain text field drops formatting while pasting into a word processor keeps it; see Inter-Process Communication.
On some systems nothing is copied at all until the paste. In the X Window System, copying merely announces ownership; the data stays with the source program, which sends it when another program asks. Close the source and the clipboard empties, which is one reason clipboard managers exist. X also keeps a second buffer, the primary selection: selecting text copies it and a middle click pastes it, with no keystroke at all. Wayland compositors carried both conventions forward but let only the focused window read the clipboard; see Display Server.
Terminals add their own complications. A pasted newline acts like pressing Enter, so a shell would run each pasted line immediately. With bracketed paste, the terminal wraps pasted text in escape sequences so the shell can treat it as input to review rather than commands to run; see ANSI Escape Code and Shell. Another escape sequence lets a program inside the terminal set the local clipboard, which works even over a remote session; see Secure Shell and Terminal Multiplexer.
The clipboard is shared, which makes it a security problem:
- Snooping. Any program allowed to read the clipboard sees passwords and messages copied from elsewhere. When iOS 14 began showing a notice whenever an app read the pasteboard in 2020, many popular apps turned out to be reading it constantly. Password managers clear the clipboard after a short delay; see Secret Management.
- Swapping. Malware watches for cryptocurrency addresses on the clipboard and replaces them with the attacker's, counting on nobody checking a long random string.
- Pastejacking. A web page can change what gets copied from it, so a harmless-looking shell command pastes as something else, ending in a newline that runs it. Instructions telling visitors to paste commands into a terminal or the Run dialog have become a common malware lure; see Phishing.
Restricting clipboard access follows the principle that a program should get only what it needs; see Least Privilege.
See also3
Undo
Letting people reverse what they just did, which makes interfaces safe to explore and usually beats asking "are you sure?" before every action.
Design & Interface17 connections
Input Method
The software layer that turns keystrokes into text for writing systems with far more characters than a keyboard has keys, such as Chinese, Japanese and Korean, by letting people type sounds or shapes and choose from candidates.
Systems & Tooling8 connections
Desktop Environment
The bundle of software that makes up a graphical desktop, including the window manager, panels, file manager, settings and a shared look, which on Linux is a choice among independent projects rather than part of the operating system.
Systems & Tooling14 connections
Linked from6
- ANSI Escape CodeSystems & Tooling
The in-band byte sequences, starting with the escape character, that tell a terminal to move the cursor, change color, or clear the screen, inherited from 1970s video terminals and still how every command-line tool draws.
- Command-Line InterfaceSystems & Tooling
Operating a computer by typing commands and reading text replies, the interface inherited from teletypes that remains the fastest, most scriptable, and least discoverable way to control software.
- Desktop EnvironmentSystems & Tooling
The bundle of software that makes up a graphical desktop, including the window manager, panels, file manager, settings and a shared look, which on Linux is a choice among independent projects rather than part of the operating system.
- Display ServerSystems & Tooling
The program that sits between applications and the screen, keyboard, and mouse, deciding what is drawn where and who receives input. On Linux it is moving from X11 to Wayland.
- Secret ManagementSystems & Tooling
Storing, distributing, and rotating credentials without embedding them in code or history.
- Terminal MultiplexerSystems & Tooling
A program that runs many terminal sessions inside one window, splits it into panes, and keeps the sessions alive on a server after the connection drops, so long jobs and remote work survive disconnection.