{"version":"2.1.280","anchor":"new-uicopy-plugin-api-for-writing-to-the-terminal-clipb","canonical_anchor":"new-uicopy-plugin-api-for-writing-to-the-terminal-clipb","heading":"New ui.copy plugin API for writing to the clipboard","tier":"use","area":"Plugins","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.280\/e\/new-uicopy-plugin-api-for-writing-to-the-terminal-clipb","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.280","markdown":"### New ui.copy plugin API for writing to the clipboard\n\nPlugins can now copy text to the terminal clipboard through a new ui.copy action\n\n**What**\n\n- A new `$.ui.copy` plugin-facing function copies text to the clipboard using OSC 52 (a terminal escape sequence for clipboard access), restricted to the terminal surface. It declines with a reason (`no-surface` or `no-clipboard`) when there's no attached UI or the text is too long for an OSC 52 write.\n\n- A matching `ui.copy` control-protocol action was added to the client, sending the text and an optional surface identifier over the same channel used for actions like `ui.focus`.\n\n- `ui.copy` was added to the capability list used by the plugin\/hooks worker sandbox, alongside existing capabilities like `ui.open`, `ui.close`, `ui.panes`, `ui.blit`, `fs.read`, and `fs.write`.\n\n**Why** This gives plugins and hooks a sanctioned way to put text on the user's clipboard, gated by the same capability and sandbox system as other UI actions, instead of needing a workaround.\n\n- Area: Plugins\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 2\/5"}