Skip to content

Instantly share code, notes, and snippets.

@lxynox
Last active April 18, 2017 01:42
Show Gist options
  • Save lxynox/8619e4e3a0a1fb9a23612d1f7d506b88 to your computer and use it in GitHub Desktop.
Save lxynox/8619e4e3a0a1fb9a23612d1f7d506b88 to your computer and use it in GitHub Desktop.
Caveats about the System Clipboard

System Clipboard

What's System Clipboard? Wiki

The clipboard is a software facility used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations.

It is most commonly a part of a GUI environment and is usually implemented as an anonymous, temporary data buffer, sometimes called the paste buffer, that can be accessed from most or all programs within the environment via defined programming interfaces. A typical application accesses clipboard functionality by mapping user input (keybindings, menu selections, etc.) to these interfaces.

Use Cases & Problems

Useful for:

  • Copy & Paste across programs (Browser and email✉️)
  • Buffer stack of Global information for sharing across GUIs

Problems:

  • Format or style issue when sharing rich text across programs
  • security issue when misused (clipboard hijack)

Some Caveats

Don't Copy-Paste from Website to Terminal

Some work-around

  • Keybindings: Use cmd+alt+shift+v instead of cmd+v (to strip format/style)
  • Use Intermediary: Text Editor for rescue (program A -> System Editor -> Program B)
  • Shell Script: pbpaste | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment