Skip to content
dsh.fish
Bundle

dsh-copy-fix

Fix DSH Desktop copy buttons by bridging clipboard writes to the Electron main process.

Source
lhh666-6
License
MIT
Updated
Updated 6 days ago

Readme

# dsh-copy-fix

> GitHub: https://github.com/lhh666-6/dsh-copy-fix
>
> npm: `dsh-copy-fix`

A profile plugin for DSH that makes the built-in copy buttons work inside the packaged **DSH Desktop** Electron app.

## Why

The DSH Desktop renderer is sandboxed. In some environments the browser Clipboard API is rejected for programmatic writes, so every copy button appears to do nothing. This plugin:

1. Wraps `navigator.clipboard.writeText`.
2. First tries the native browser write.
3. Then POSTs the text to a plugin-owned loopback route.
4. The Host side writes it through Electron's main-process clipboard.
5. Finally falls back to `document.execCommand('copy')`.

## Install in a profile

```sh
# npm (recommended, prebuilt)
dsh plugin --profile desktop add dsh-copy-fix
dsh plugin --profile web add dsh-copy-fix

# or directly from GitHub
dsh plugin --profile desktop add github:lhh666-6/dsh-copy-fix
dsh plugin --profile web add github:lhh666-6/dsh-copy-fix
```

Then restart DSH Desktop.

Install

dsh plugin --profile web add github:lhh666-6/dsh-copy-fix#12135ad4aa974e43c67f5ad84c279ab154bf7c89

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
Source