Clipboard (computing)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 6 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

The clipboard is a buffer that some operating systems provide for short-term storage and transfer across applications. The clipboard provides an application programming interface by which programs can specify cut, copy and paste operations. It is left to the program to define methods for the user to command these operations, which may include keybindings and menu selections. When an element is copied or cut, the clipboard must store enough information to enable a sensible result no matter where the element is pasted. Application programs may extend the clipboard functions that the operating system provides. A clipboard manager may give the user additional control over the clipboard. Specific clipboard semantics vary among operating systems, can also vary between versions of the same system, and can sometimes be changed by programs and by user preferences. Windows and macOS support a single clipboard transaction; however, Linux desktops generally provide a full history of clipboard transactions (sometimes called a kill ring) to the user, allowing them to store several pieces of information at once before retrieving them on demand.

The clipboard is a buffer that some operating systems provide for short-term storage and transfer across applications. The clipboard provides an application programming interface by which programs can specify cut, copy and paste operations. It is left to the program to define methods for the user to command these operations, which may include keybindings and menu selections. When an element is copied or cut, the clipboard must store enough information to enable a sensible result no matter where the element is pasted. Application programs may extend the clipboard functions that the operating system provides. A clipboard manager may give the user additional control over the clipboard. Specific clipboard semantics vary among operating systems, can also vary between versions of the same system, and can sometimes be changed by programs and by user preferences. Windows and macOS support a single clipboard transaction; however, Linux desktops generally provide a full history of clipboard transactions (sometimes called a kill ring) to the user, allowing them to store several pieces of information at once before retrieving them on demand.

Computer security

Clipboard hijacking or clipboard injection is an exploit in which a person's clipboard's content is replaced by malicious data, such as a link to a malicious web site. For example, if a user copies a cryptocurrency receiving address into the clipboard, a hijacking program can overwrite it with an address controlled by the hijacker, so that when the user pastes the address their cryptocurrency is transmitted to the hijacker instead of the intended recipient. While some security-holes were patched, JavaScript can still be used to modify clipboard content via an attack dubbed 'pastejacking'. Dylan Ayrey who developed the attack set up a website that demonstrates how this exploit can be used to trick a user into running commands they didn't want to run. There have been exploits where web pages grab clipboard data. In early 2013 researchers exposed risks stemming from Android-based password managers and documented how passwords in 21 of the most popular of these apps could be accessed by any other app on an Android device including those with extremely low-level privileges. Joe Siegrist notes that this is an "OS-level issue that impacts everything running on Android".

Clipboard management and extensions

, an example of a clipboard management program]] Clipboard manager extensions add functionality to the integrated clipboard functions of an operating system. They are applications that enable the user to manipulate the clipboard. On platforms such as Linux that use multiple incompatible GUI toolkits, clipboard managers are often used to transfer data between applications using different such frameworks. When a clipboard manager provides multiple cut and paste transactions, the clipboard is treated as a stack or scrap book, with new cuts and copies being placed on a list of recent transactions. The standard paste operation copies the most recent transaction, while specialized pastes provide access to the other stored transactions. These managers generally also provide a window that displays the transaction history and allows the user to select earlier copies, edit them, change their format and even search amongst them. Since most operating systems (e.g. Windows, macOS, Linux, X11, Android, iOS) do not save the clipboard contents to any persistent storage – when a user logs out or reboots the system the clipboard contents are deleted – an added functionality is to save the clipboard persistently. Another example is making the local clipboard work with online applications by saving the clipboard data to the online location upon a copy or cut event, making this data available to online applications for pasting. Clipboard managers can also serve as tools to overcome the limitation of software not supporting copying and pasting (for example, while logging into remote Windows server, one cannot copy and paste their user name and password). $ # to copy data into the clipboard: $ echo 'hello world' | pbcopy $ # to paste from the clipboard: $ pbpaste hello world $ # to paste the content of a folder to the clipboard: $ dir | clip The clipboard can also be accessed via PowerShell: to paste the content of a directory to the clipboard Set-Clipboard -Path "C:\directory\" to get the content of the clipboard Get-Clipboard Windows 10 and Windows 11 include the Clipboard application, allowing for the storage of multiple text-based clipboard items. It can be accessed by pressing Windows+V. $ # to paste standard output to the clipboard using xclip $ echo text | xclip -in -selection clipboard $ # to paste standard output to the clipboard using xsel $ echo text | xsel --clipboard The main difference to OS X and Windows is that no data is actually stored in the CLIPBOARD-clipboard but only the reference to the copied or cut data. The application claims the ownership of the CLIPBOARD selection and communicates its ownership to the X Server. When pasting this data, the data and its available formats are requested from the application that owns the CLIPBOARD selection. Windows Dev Center: Transferring Shell Objects with Drag-and-Drop and the Clipboard Microsoft Developer Network: How the Clipboard Works, Part 1 Microsoft Developer Network: How the Clipboard Works, Part 2 Microsoft Developer Network: Delayed Rendering of Clipboard Data

Text derived from https://en.wikipedia.org/w/index.php?oldid=1376388187 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

24 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.