Copying rendered math from the chat puts the formula's LaTeX source on the clipboard instead of KaTeX's visual glyph text.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:YizhouLouisLu/dsh-math-copy
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English | 中文
Copying rendered math from the DSH Web UI puts the formula's LaTeX source on
the clipboard, instead of KaTeX's visual glyph text (x2 for x^2).
What it does
The Web UI renders math with KaTeX, and KaTeX keeps the original TeX source in the formula's accessibility subtree:
<span class="katex">
<span class="katex-mathml"><math>…<annotation encoding="application/x-tex">\frac{a}{b}</annotation>…</math></span>
<span class="katex-html" aria-hidden="true">…glyphs…</span>
</span>
The browser's own selection copy walks the visible layout (and the clipped MathML
arm), so it produces glyph text. This plugin listens for copy on the document;
when the selection intersects at least one formula it marks those formulas,
clones the selection, swaps each formula for its TeX wrapped in math delimiters,
writes text/plain (and text/html) and cancels the default action. A copy
whose selection holds no math is left completely alone.
Selecting half a formula still yields the whole formula's TeX.
Configuration
Three fields, editable in the Plugins page:
| field | default | meaning |
|---|---|---|
| Inline formula delimiter | "$" |
wrapped around inline math (empty → bare TeX) |
| Display formula delimiter | "$$" |
wrapped around display math (empty → bare TeX) |
| Also replace the rich-text flavor | true |
substitute math in the text/html flavor too; off keeps the untouched selection markup for rich paste targets |
How the form is wired
index.jsdeclares the fields onexport const Configand marks each one.volatile(). Only volatile fields are projected into a form: the settings service serves them under this entry's profile row id,math-copy.client.jssubscribes to that form throughctx.configForms.get("math-copy")(the same way the shippedui-chatreads its preferences) and folds it over its own defaults, so the copy handler always reads the current values.- The panel is registered into the
plugins.row.configslot with the key<package name>#<row id>(dsh-math-copy#math-copy). No shipped client renders settings forms automatically, so the plugin renders its own.
Find it at 插件 (Plugins) → dsh-math-copy → the math-copy row → its
configuration block. Writes go through the settings transport and are
persisted into the active profile's Cordis patch, so they survive restarts.
Changing the host half (index.js) needs a DSH restart: the host module
generation is cached for the process lifetime, and the profile's HMR entry runs
with root: [] (no source watching). Client-only edits (client.js) reach the
page on a reload.
Install
# from a session with Full access:
# plugin_manager action=install_bundle target=<this directory>
Reload the Web UI page afterwards so the new client bundle enters the boot graph.
Restarting DSH after a host-half change is required — the host module generation is cached for the process lifetime.
Status
Developed and verified against dsh core 0.2.0-rc.2 (DSH Desktop
2.0.15-beta.1). No engines.dsh range is declared yet: the plugin uses
long-standing client services (slots, locale, configForms, ctx.inject),
but only this version has actually been run, and a range that admits prerelease
builds has to name each major.minor.patch tuple explicitly. Declare one once
another version has been tested.
Development
tools/asar-extract.mjs reads Electron's app.asar (list or extract by path
substring) — used to read the shipped client code that renders markdown and math:
node tools/asar-extract.mjs "/Applications/DeepSeek Harness.app/Contents/Resources/app.asar" list katex
node tools/asar-extract.mjs "/Applications/DeepSeek Harness.app/Contents/Resources/app.asar" extract dsh-client-ui-primitives /tmp/dshx
index.js resolves @deepseek-ai/schemastery through the active profile when
the direct specifier misses (a directory-installed bundle is linked into the
profile, so Node resolves its imports from the workspace instead). Without the
schema the plugin still copies with its built-in defaults; only the form is
missing. A normally installed copy (npm or GitHub, which is what
dshmarket performs) resolves the direct specifier and never reaches the
fallback.
submission/ holds the one-file catalog entry for
awesome-dsh-plugin;
see the notes inside it.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10686
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10686
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8436
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7504
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5379
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1076
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.